public class WrappedBytes extends AbstractBytes
| Constructor and Description |
|---|
WrappedBytes(Bytes bytes) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Bytes |
flush()
Flushes the bytes to the underlying persistence layer.
|
ByteOrder |
order()
Returns the byte order.
|
Bytes |
read(int offset,
byte[] dst,
int dstOffset,
int length)
Reads bytes into the given byte array starting at the given offset up to the given length.
|
Bytes |
read(int offset,
Bytes dst,
int dstOffset,
int length)
Reads bytes into the given byte array starting at the given offset up to the given length.
|
boolean |
readBoolean(int offset)
Reads a 1 byte boolean from the buffer at the given offset.
|
int |
readByte(int offset)
Reads a byte from the buffer at the given offset.
|
char |
readChar(int offset)
Reads a 16-bit character from the buffer at the given offset.
|
double |
readDouble(int offset)
Reads a double-precision 64-bit floating point number from the buffer at the given offset.
|
float |
readFloat(int offset)
Reads a single-precision 32-bit floating point number from the buffer at the given offset.
|
int |
readInt(int offset)
Reads a 32-bit signed integer from the buffer at the given offset.
|
long |
readLong(int offset)
Reads a 64-bit signed integer from the buffer at the given offset.
|
int |
readMedium(int offset)
Reads a 24-bit signed integer from the buffer at the given offset.
|
short |
readShort(int offset)
Reads a 16-bit signed integer from the buffer at the given offset.
|
String |
readString(int offset)
Reads a string from the buffer at the given offset.
|
int |
readUnsignedByte(int offset)
Reads an unsigned byte from the buffer at the given offset.
|
long |
readUnsignedInt(int offset)
Reads a 32-bit unsigned integer from the buffer at the given offset.
|
int |
readUnsignedMedium(int offset)
Reads a 24-bin unsigned integer from the buffer at the given offset.
|
int |
readUnsignedShort(int offset)
Reads a 16-bit unsigned integer from the buffer at the given offset.
|
String |
readUTF8(int offset)
Reads a UTF-8 string from the buffer at the given offset.
|
Bytes |
resize(int newSize)
Resizes the bytes.
|
Bytes |
root()
Returns the root bytes.
|
int |
size()
Returns the count of the bytes.
|
Bytes |
write(int offset,
byte[] src,
int srcOffset,
int length)
Writes an array of bytes to the buffer.
|
Bytes |
write(int offset,
Bytes src,
int srcOffset,
int length)
Writes an array of bytes to the buffer.
|
Bytes |
writeBoolean(int offset,
boolean b)
Writes a 1 byte boolean to the buffer at the given offset.
|
Bytes |
writeByte(int offset,
int b)
Writes a byte to the buffer at the given offset.
|
Bytes |
writeChar(int offset,
char c)
Writes a 16-bit character to the buffer at the given offset.
|
Bytes |
writeDouble(int offset,
double d)
Writes a double-precision 64-bit floating point number to the buffer at the given offset.
|
Bytes |
writeFloat(int offset,
float f)
Writes a single-precision 32-bit floating point number to the buffer at the given offset.
|
Bytes |
writeInt(int offset,
int i)
Writes a 32-bit signed integer to the buffer at the given offset.
|
Bytes |
writeLong(int offset,
long l)
Writes a 64-bit signed integer to the buffer at the given offset.
|
Bytes |
writeMedium(int offset,
int m)
Writes a 24-bit signed integer to the buffer at the given offset.
|
Bytes |
writeShort(int offset,
short s)
Writes a 16-bit signed integer to the buffer at the given offset.
|
Bytes |
writeString(int offset,
String s)
Writes a string to the buffer at the given offset.
|
Bytes |
writeUnsignedByte(int offset,
int b)
Writes an unsigned byte to the buffer at the given position.
|
Bytes |
writeUnsignedInt(int offset,
long i)
Writes a 32-bit unsigned integer to the buffer at the given offset.
|
Bytes |
writeUnsignedMedium(int offset,
int m)
Writes a 24-bit unsigned integer to the buffer at the given offset.
|
Bytes |
writeUnsignedShort(int offset,
int s)
Writes a 16-bit unsigned integer to the buffer at the given offset.
|
Bytes |
writeUTF8(int offset,
String s)
Writes a UTF-8 string to the buffer at the given offset.
|
Bytes |
zero()
Zeros out all bytes in the array.
|
Bytes |
zero(int offset)
Zeros out all bytes starting at the given offset in the array.
|
Bytes |
zero(int offset,
int length)
Zeros out bytes starting at the given offset up to the given length.
|
isDirect, isFile, order, readString, writeStringpublic WrappedBytes(Bytes bytes)
public Bytes root()
public int size()
Bytespublic Bytes resize(int newSize)
Bytes
When the bytes are resized, underlying memory addresses in copies of this instance may no longer be valid. Additionally,
if the newSize is smaller than the current count then some data may be lost during the resize. Use
with caution.
newSize - The count to which to resize this instance.public ByteOrder order()
Bytes
For consistency with ByteBuffer, all bytes implementations are initially in ByteOrder.BIG_ENDIAN order.
order in interface Bytesorder in class AbstractBytespublic Bytes zero()
BytesOutputpublic Bytes zero(int offset)
BytesOutputoffset - The offset at which to start zeroing out bytes.public Bytes zero(int offset, int length)
BytesOutputoffset - The offset at which to start zeroing out bytes.length - THe total number of bytes to zero out.public Bytes read(int offset, Bytes dst, int dstOffset, int length)
BytesInputoffset - The offset from which to start reading bytes.dst - The byte array into which to read bytes.dstOffset - The offset at which to write bytes into the given buffer.length - The total number of bytes to read.public Bytes read(int offset, byte[] dst, int dstOffset, int length)
BytesInputoffset - The offset from which to start reading bytes.dst - The byte array into which to read bytes.dstOffset - The offset at which to write bytes into the given bufferlength - The total number of bytes to read.public int readByte(int offset)
BytesInputoffset - The offset at which to read the byte.public int readUnsignedByte(int offset)
BytesInputreadUnsignedByte in interface BytesInput<Bytes>readUnsignedByte in class AbstractBytesoffset - The offset at which to read the byte.public char readChar(int offset)
BytesInputoffset - The offset at which to read the character.public short readShort(int offset)
BytesInputoffset - The offset at which to read the short.public int readUnsignedShort(int offset)
BytesInputreadUnsignedShort in interface BytesInput<Bytes>readUnsignedShort in class AbstractBytesoffset - The offset at which to read the short.public int readMedium(int offset)
BytesInputreadMedium in interface BytesInput<Bytes>readMedium in class AbstractBytesoffset - The offset at which to read the integer.public int readUnsignedMedium(int offset)
BytesInputreadUnsignedMedium in interface BytesInput<Bytes>readUnsignedMedium in class AbstractBytesoffset - The offset at which to read the integer.public int readInt(int offset)
BytesInputoffset - The offset at which to read the integer.public long readUnsignedInt(int offset)
BytesInputreadUnsignedInt in interface BytesInput<Bytes>readUnsignedInt in class AbstractBytesoffset - The offset at which to read the integer.public long readLong(int offset)
BytesInputoffset - The offset at which to read the long.public float readFloat(int offset)
BytesInputoffset - The offset at which to read the float.public double readDouble(int offset)
BytesInputoffset - The offset at which to read the double.public boolean readBoolean(int offset)
BytesInputreadBoolean in interface BytesInput<Bytes>readBoolean in class AbstractBytesoffset - The offset at which to read the boolean.public String readString(int offset)
BytesInputreadString in interface BytesInput<Bytes>readString in class AbstractBytesoffset - The offset at which to read the string.public String readUTF8(int offset)
BytesInputreadUTF8 in interface BytesInput<Bytes>readUTF8 in class AbstractBytesoffset - The offset at which to read the string.public Bytes write(int offset, Bytes src, int srcOffset, int length)
BytesOutputoffset - The offset at which to start writing the bytes.src - The array of bytes to write.srcOffset - The offset at which to start reading bytes from the given source.length - The number of bytes from the provided byte array to write to the buffer.public Bytes write(int offset, byte[] src, int srcOffset, int length)
BytesOutputoffset - The offset at which to start writing the bytes.src - The array of bytes to write.srcOffset - The offset at which to start reading bytes from the given source.length - The number of bytes from the provided byte array to write to the buffer.public Bytes writeByte(int offset, int b)
BytesOutputoffset - The offset at which to write the byte.b - The byte to write.public Bytes writeUnsignedByte(int offset, int b)
BytesOutputwriteUnsignedByte in interface BytesOutput<Bytes>writeUnsignedByte in class AbstractBytesoffset - The offset at which to write the byte.b - The byte to write.public Bytes writeChar(int offset, char c)
BytesOutputoffset - The offset at which to write the character.c - The character to write.public Bytes writeShort(int offset, short s)
BytesOutputoffset - The offset at which to write the short.s - The short to write.public Bytes writeUnsignedShort(int offset, int s)
BytesOutputwriteUnsignedShort in interface BytesOutput<Bytes>writeUnsignedShort in class AbstractBytesoffset - The offset at which to write the short.s - The short to write.public Bytes writeMedium(int offset, int m)
BytesOutputwriteMedium in interface BytesOutput<Bytes>writeMedium in class AbstractBytesoffset - The offset at which to write the short.m - The short to write.public Bytes writeUnsignedMedium(int offset, int m)
BytesOutputwriteUnsignedMedium in interface BytesOutput<Bytes>writeUnsignedMedium in class AbstractBytesoffset - The offset at which to write the short.m - The short to write.public Bytes writeInt(int offset, int i)
BytesOutputoffset - The offset at which to write the integer.i - The integer to write.public Bytes writeUnsignedInt(int offset, long i)
BytesOutputwriteUnsignedInt in interface BytesOutput<Bytes>writeUnsignedInt in class AbstractBytesoffset - The offset at which to write the integer.i - The integer to write.public Bytes writeLong(int offset, long l)
BytesOutputoffset - The offset at which to write the long.l - The long to write.public Bytes writeFloat(int offset, float f)
BytesOutputoffset - The offset at which to write the float.f - The float to write.public Bytes writeDouble(int offset, double d)
BytesOutputoffset - The offset at which to write the double.d - The double to write.public Bytes writeBoolean(int offset, boolean b)
BytesOutputwriteBoolean in interface BytesOutput<Bytes>writeBoolean in class AbstractBytesoffset - The offset at which to write the boolean.b - The boolean to write.public Bytes writeString(int offset, String s)
BytesOutputwriteString in interface BytesOutput<Bytes>writeString in class AbstractBytesoffset - The offset at which to write the string.s - The string to write.public Bytes writeUTF8(int offset, String s)
BytesOutputwriteUTF8 in interface BytesOutput<Bytes>writeUTF8 in class AbstractBytesoffset - The offset at which to write the string.s - The string to write.public Bytes flush()
BytesOutputflush in interface BytesOutput<Bytes>flush in class AbstractBytespublic void close()
close in interface Bytesclose in interface AutoCloseableclose in class AbstractBytesCopyright © 2013–2017. All rights reserved.