|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.nativelibs4java.util.NIOUtils
public class NIOUtils
NIO Buffer util methods
| Constructor Summary | |
|---|---|
NIOUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
directBuffer(int size,
ByteOrder order,
Class<B> bufferClass)
Creates a direct buffer of the specified size (in elements) and type.. |
|
static ByteBuffer |
directBytes(int size,
ByteOrder order)
Creates a direct byte buffer of the specified size (in elements) and a native byte order |
|
static CharBuffer |
directChars(int size,
ByteOrder order)
Creates a direct char buffer of the specified size (in elements) and a native byte order |
|
static ByteBuffer |
directCopy(Buffer b,
ByteOrder order)
|
|
static CharBuffer |
directCopy(CharBuffer b,
ByteOrder order)
|
|
static DoubleBuffer |
directCopy(DoubleBuffer b,
ByteOrder order)
|
|
static FloatBuffer |
directCopy(FloatBuffer b,
ByteOrder order)
|
|
static IntBuffer |
directCopy(IntBuffer b,
ByteOrder order)
|
|
static LongBuffer |
directCopy(LongBuffer b,
ByteOrder order)
|
|
static ShortBuffer |
directCopy(ShortBuffer b,
ByteOrder order)
|
|
static DoubleBuffer |
directDoubles(int size,
ByteOrder order)
Creates a direct double buffer of the specified size (in elements) and a native byte order |
|
static FloatBuffer |
directFloats(int size,
ByteOrder order)
Creates a direct float buffer of the specified size (in elements) and a native byte order |
|
static IntBuffer |
directInts(int size,
ByteOrder order)
Creates a direct int buffer of the specified size (in elements) and a native byte order |
|
static LongBuffer |
directLongs(int size,
ByteOrder order)
Creates a direct lpng buffer of the specified size (in elements) and a native byte order |
|
static ShortBuffer |
directShorts(int size,
ByteOrder order)
Creates a direct short buffer of the specified size (in elements) and a native byte order |
|
static
|
get(B buffer,
int position)
|
|
static
|
getArray(B buffer)
|
|
static Class<? extends Buffer> |
getBufferClass(Class<?> primitiveClass)
|
|
static ByteOrder |
getByteOrder(Buffer buffer)
|
|
static int |
getComponentSizeInBytes(Buffer b)
Get the size in bytes of a primitive component of a buffer |
|
static Class<?> |
getPrimitiveClass(Class<? extends Buffer> bufferClass)
|
|
static long |
getSizeInBytes(Buffer b)
Get the size in bytes of a buffer |
|
static
|
indirectBuffer(int size,
Class<B> bufferClass)
Creates a indirect buffer of the specified size (in elements) and type.. |
|
static
|
put(B buffer,
int position,
V value)
|
|
static void |
put(Buffer input,
Buffer output)
Bulk-copy all of the input buffer into the output buffer |
|
static void |
put(Buffer input,
ByteBuffer outputBytes)
Bulk-copy all of the input buffer into the output buffer |
|
static void |
put(ByteBuffer inputBytes,
Buffer output)
Bulk-copy all input bytes into output buffer |
|
static
|
wrapArray(Object a)
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NIOUtils()
| Method Detail |
|---|
public static Class<? extends Buffer> getBufferClass(Class<?> primitiveClass)
public static Class<?> getPrimitiveClass(Class<? extends Buffer> bufferClass)
public static void put(Buffer input,
Buffer output)
input - output -
public static void put(Buffer input,
ByteBuffer outputBytes)
input - outputBytes -
public static void put(ByteBuffer inputBytes,
Buffer output)
inputBytes - output -
public static IntBuffer directCopy(IntBuffer b,
ByteOrder order)
public static LongBuffer directCopy(LongBuffer b,
ByteOrder order)
public static ShortBuffer directCopy(ShortBuffer b,
ByteOrder order)
public static CharBuffer directCopy(CharBuffer b,
ByteOrder order)
public static DoubleBuffer directCopy(DoubleBuffer b,
ByteOrder order)
public static FloatBuffer directCopy(FloatBuffer b,
ByteOrder order)
public static ByteBuffer directCopy(Buffer b,
ByteOrder order)
public static IntBuffer directInts(int size,
ByteOrder order)
size - size of the buffer in elementsorder - byte order of the direct buffer
public static LongBuffer directLongs(int size,
ByteOrder order)
size - size of the buffer in elementsorder - byte order of the direct buffer
public static ShortBuffer directShorts(int size,
ByteOrder order)
size - size of the buffer in elementsorder - byte order of the direct buffer
public static ByteBuffer directBytes(int size,
ByteOrder order)
size - size of the buffer in elementsorder - byte order of the direct buffer
public static FloatBuffer directFloats(int size,
ByteOrder order)
size - size of the buffer in elementsorder - byte order of the direct buffer
public static CharBuffer directChars(int size,
ByteOrder order)
size - size of the buffer in elementsorder - byte order of the direct buffer
public static DoubleBuffer directDoubles(int size,
ByteOrder order)
size - size of the buffer in elementsorder - byte order of the direct buffer
public static <B extends Buffer> B directBuffer(int size,
ByteOrder order,
Class<B> bufferClass)
size - size of the buffer in elementsorder - byte order of the direct bufferbufferClass - type of the buffer. Must be one of IntBuffer.class, LongBuffer.class, ShortBuffer.class, ByteBuffer.class, DoubleBuffer.class, FloatBuffer.class
public static <B extends Buffer> B indirectBuffer(int size,
Class<B> bufferClass)
size - size of the buffer in elementsbufferClass - type of the buffer. Must be one of IntBuffer.class, LongBuffer.class, ShortBuffer.class, ByteBuffer.class, DoubleBuffer.class, FloatBuffer.class
public static long getSizeInBytes(Buffer b)
public static int getComponentSizeInBytes(Buffer b)
public static <B extends Buffer,V> void put(B buffer,
int position,
V value)
public static <B extends Buffer,V> V get(B buffer,
int position)
public static <B extends Buffer> Object getArray(B buffer)
public static <B extends Buffer> B wrapArray(Object a)
public static ByteOrder getByteOrder(Buffer buffer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||