public class ByteBufferImpl extends java.lang.Object implements ByteBuffer
Modifier and Type | Class and Description |
---|---|
static class |
ByteBufferImpl.Externalizer |
Modifier and Type | Field and Description |
---|---|
private byte[] |
buf |
private int |
length |
private int |
offset |
Constructor and Description |
---|
ByteBufferImpl(byte[] buf,
int offset,
int length) |
Modifier and Type | Method and Description |
---|---|
ByteBufferImpl |
copy()
Returns a new byte[] instance of size
ByteBuffer.getLength() that contains all the bytes owned by this buffer. |
boolean |
equals(java.lang.Object o) |
byte[] |
getBuf()
Returns the underlying buffer.
|
int |
getLength()
Length bytes, starting from offset, within the underlying byte[] (as returned by
ByteBuffer.getBuf() are owned
by this buffer instance. |
int |
getOffset()
Returns the offset within the underlying byte[] (as returned by
ByteBuffer.getBuf() owned by this buffer instance. |
java.io.InputStream |
getStream() |
int |
hashCode() |
java.nio.ByteBuffer |
toJDKByteBuffer() |
java.lang.String |
toString() |
private final byte[] buf
private final int offset
private final int length
public byte[] getBuf()
ByteBuffer
getBuf
in interface ByteBuffer
public int getOffset()
ByteBuffer
ByteBuffer.getBuf()
owned by this buffer instance.getOffset
in interface ByteBuffer
public int getLength()
ByteBuffer
ByteBuffer.getBuf()
are owned
by this buffer instance.getLength
in interface ByteBuffer
public ByteBufferImpl copy()
ByteBuffer
ByteBuffer.getLength()
that contains all the bytes owned by this buffer.copy
in interface ByteBuffer
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.io.InputStream getStream()
public java.nio.ByteBuffer toJDKByteBuffer()