|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrebuild.comp.java.nio.Buffer
rebuild.comp.java.nio.ByteBuffer
public abstract class ByteBuffer
A skimmed down version of the ByteBuffer class for use in versions lower then 5.0. Based off J2SE java.nio.ByteBuffer class but no source code used for it.
Method Summary | |
---|---|
static ByteBuffer |
allocateDirect(int capacity)
Allocates a new direct byte buffer. |
byte[] |
array()
Returns the byte array that backs this buffer. |
int |
arrayOffset()
Returns the offset within this buffer's backing array of the first element of the buffer. |
abstract ShortBuffer |
asShortBuffer()
Creates a view of this byte buffer as a short buffer. |
abstract byte |
get()
Relative get method. |
ByteBuffer |
get(byte[] dst)
Relative bulk get method. |
ByteBuffer |
get(byte[] dst,
int offset,
int length)
This method transfers bytes from this buffer into the given destination array. |
abstract byte |
get(int index)
Absolute get method. |
abstract int |
getInt()
Relative get method for reading an int value. |
abstract short |
getShort()
Relative get method for reading a short value. |
abstract short |
getShort(int index)
Absolute get method for reading a short value. |
boolean |
hasArray()
Tells whether or not this buffer is backed by an accessible byte array. |
abstract ByteBuffer |
put(byte b)
Writes the given byte into this buffer at the current position, and then increments the position. |
ByteBuffer |
put(byte[] src)
This method transfers the entire content of the given source byte array into this buffer. |
ByteBuffer |
put(byte[] src,
int offset,
int length)
Relative bulk put method |
ByteBuffer |
put(ByteBuffer src)
This method transfers the bytes remaining in the given source buffer into this buffer. |
abstract ByteBuffer |
put(int index,
byte b)
Writes the given byte into this buffer at the given index. |
abstract ByteBuffer |
putInt(int value)
Relative put method for writing an int value. |
abstract ByteBuffer |
putInt(int index,
int value)
Absolute put method for writing an int value. |
abstract ByteBuffer |
putShort(short value)
Relative put method for writing a short value. |
abstract ByteBuffer |
slice()
Creates a new byte buffer whose content is a shared subsequence of this buffer's content. |
static ByteBuffer |
wrap(byte[] array)
Wraps a byte array into a buffer. |
Methods inherited from class rebuild.comp.java.nio.Buffer |
---|
capacity, clear, flip, hasRemaining, limit, limit, position, position, remaining, rewind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ByteBuffer allocateDirect(int capacity)
capacity
- The new buffer's capacity, in bytes.
public static ByteBuffer wrap(byte[] array)
array
- The array that will back this buffer.
public abstract ShortBuffer asShortBuffer()
public abstract ByteBuffer put(byte b)
b
- The byte to be written.
public abstract ByteBuffer put(int index, byte b)
index
- The index at which the byte will be written.b
- The byte value to be written.
public ByteBuffer put(ByteBuffer src)
src
- The source buffer from which bytes are to be read; must not be this buffer.
public final ByteBuffer put(byte[] src)
public ByteBuffer put(byte[] src, int offset, int length)
src
- The array from which bytes are to be read.offset
- The offset within the array of the first byte to be read; must be non-negative and no larger than array.length.length
- The number of bytes to be read from the given array; must be non-negative and no larger than array.length - offset.
public abstract ByteBuffer putShort(short value)
value
- The short value to be written.
public abstract ByteBuffer putInt(int value)
value
- The int value to be written.
public abstract ByteBuffer putInt(int index, int value)
index
- The index at which the bytes will be written.value
- The int value to be written.
public abstract byte get()
public abstract byte get(int index)
index
- The index from which the byte will be read.
public ByteBuffer get(byte[] dst)
public ByteBuffer get(byte[] dst, int offset, int length)
dst
- The array into which bytes are to be written.offset
- The offset within the array of the first byte to be written; must be non-negative and no larger than dst.length.length
- The maximum number of bytes to be written to the given array; must be non-negative and no larger than dst.length - offset.
public abstract short getShort()
public abstract short getShort(int index)
index
- The index from which the bytes will be read
public abstract int getInt()
public final byte[] array()
public final boolean hasArray()
public final int arrayOffset()
public abstract ByteBuffer slice()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |