Build 1.0_r1(from source)

java.nio
Class BufferFactory

java.lang.Object
  extended by java.nio.BufferFactory

final class BufferFactory
extends Object

Provide factory service of buffer classes.

Since all buffer impl classes are package private (except DirectByteBuffer), this factory is the only entrance to access buffer functions from outside of the impl package.


Constructor Summary
BufferFactory()
           
 
Method Summary
static ByteBuffer newByteBuffer(byte[] array)
          Returns a new byte buffer based on the specified byte array.
static ByteBuffer newByteBuffer(int capacity)
          Returns a new array based byte buffer with the specified capacity.
static CharBuffer newCharBuffer(char[] array)
          Returns a new char buffer based on the specified char array.
static CharBuffer newCharBuffer(CharSequence chseq)
          Returns a new readonly char buffer based on the specified char sequence.
static CharBuffer newCharBuffer(int capacity)
          Returns a new array based char buffer with the specified capacity.
static ByteBuffer newDirectByteBuffer(int capacity)
          Returns a new direct byte buffer with the specified capacity.
static DoubleBuffer newDoubleBuffer(double[] array)
          Returns a new double buffer based on the specified double array.
static DoubleBuffer newDoubleBuffer(int capacity)
          Returns a new array based double buffer with the specified capacity.
static FloatBuffer newFloatBuffer(float[] array)
          Returns a new float buffer based on the specified float array.
static FloatBuffer newFloatBuffer(int capacity)
          Returns a new array based float buffer with the specified capacity.
static IntBuffer newIntBuffer(int capacity)
          Returns a new array based int buffer with the specified capacity.
static IntBuffer newIntBuffer(int[] array)
          Returns a new int buffer based on the specified int array.
static LongBuffer newLongBuffer(int capacity)
          Returns a new array based long buffer with the specified capacity.
static LongBuffer newLongBuffer(long[] array)
          Returns a new long buffer based on the specified long array.
static ShortBuffer newShortBuffer(int capacity)
          Returns a new array based short buffer with the specified capacity.
static ShortBuffer newShortBuffer(short[] array)
          Returns a new short buffer based on the specified short array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferFactory

BufferFactory()
Method Detail

newByteBuffer

public static ByteBuffer newByteBuffer(byte[] array)
Returns a new byte buffer based on the specified byte array.

Parameters:
array - The byte array
Returns:
A new byte buffer based on the specified byte array.

newByteBuffer

public static ByteBuffer newByteBuffer(int capacity)
Returns a new array based byte buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new array based byte buffer with the specified capacity.

newCharBuffer

public static CharBuffer newCharBuffer(char[] array)
Returns a new char buffer based on the specified char array.

Parameters:
array - The char array
Returns:
A new char buffer based on the specified char array.

newCharBuffer

public static CharBuffer newCharBuffer(CharSequence chseq)
Returns a new readonly char buffer based on the specified char sequence.

Parameters:
chseq - The char sequence
Returns:
A new readonly char buffer based on the specified char sequence.

newCharBuffer

public static CharBuffer newCharBuffer(int capacity)
Returns a new array based char buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new array based char buffer with the specified capacity.

newDirectByteBuffer

public static ByteBuffer newDirectByteBuffer(int capacity)
Returns a new direct byte buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new direct byte buffer with the specified capacity.

newDoubleBuffer

public static DoubleBuffer newDoubleBuffer(double[] array)
Returns a new double buffer based on the specified double array.

Parameters:
array - The double array
Returns:
A new double buffer based on the specified double array.

newDoubleBuffer

public static DoubleBuffer newDoubleBuffer(int capacity)
Returns a new array based double buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new array based double buffer with the specified capacity.

newFloatBuffer

public static FloatBuffer newFloatBuffer(float[] array)
Returns a new float buffer based on the specified float array.

Parameters:
array - The float array
Returns:
A new float buffer based on the specified float array.

newFloatBuffer

public static FloatBuffer newFloatBuffer(int capacity)
Returns a new array based float buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new array based float buffer with the specified capacity.

newIntBuffer

public static IntBuffer newIntBuffer(int capacity)
Returns a new array based int buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new array based int buffer with the specified capacity.

newIntBuffer

public static IntBuffer newIntBuffer(int[] array)
Returns a new int buffer based on the specified int array.

Parameters:
array - The int array
Returns:
A new int buffer based on the specified int array.

newLongBuffer

public static LongBuffer newLongBuffer(int capacity)
Returns a new array based long buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new array based long buffer with the specified capacity.

newLongBuffer

public static LongBuffer newLongBuffer(long[] array)
Returns a new long buffer based on the specified long array.

Parameters:
array - The long array
Returns:
A new long buffer based on the specified long array.

newShortBuffer

public static ShortBuffer newShortBuffer(int capacity)
Returns a new array based short buffer with the specified capacity.

Parameters:
capacity - The capacity of the new buffer
Returns:
A new array based short buffer with the specified capacity.

newShortBuffer

public static ShortBuffer newShortBuffer(short[] array)
Returns a new short buffer based on the specified short array.

Parameters:
array - The short array
Returns:
A new short buffer based on the specified short array.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature