public abstract class AbstractBytes extends Object implements Bytes
This class provides common state and bounds checking functionality for all Bytes implementations.
| Constructor and Description |
|---|
AbstractBytes() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isDirect()
Returns a boolean value indicating whether the bytes are direct.
|
boolean |
isFile()
Returns a boolean value indicating whether the bytes are backed by a file.
|
ByteOrder |
order()
Returns the byte order.
|
Bytes |
order(ByteOrder order)
Sets the byte order, returning a new swapped
Bytes instance. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, read, readBoolean, readByte, readChar, readDouble, readFloat, readInt, readLong, readMedium, readShort, readString, readUnsignedByte, readUnsignedInt, readUnsignedMedium, readUnsignedShort, readUTF8flush, write, write, writeBoolean, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeMedium, writeShort, writeString, writeUnsignedByte, writeUnsignedInt, writeUnsignedMedium, writeUnsignedShort, writeUTF8, zero, zero, zeropublic boolean isDirect()
Bytespublic boolean isFile()
Bytespublic ByteOrder order()
Bytes
For consistency with ByteBuffer, all bytes implementations are initially in ByteOrder.BIG_ENDIAN order.
public Bytes order(ByteOrder order)
BytesBytes instance.
By default, all bytes are read and written in ByteOrder.BIG_ENDIAN order. This provides complete
consistency with ByteBuffer. To flip bytes to ByteOrder.LITTLE_ENDIAN order, this
Bytes instance is decorated by a SwappedBytes instance which will reverse
read and written bytes using, e.g. Integer.reverseBytes(int).
public void close()
close in interface AutoCloseableclose in interface BytesCopyright © 2013–2015. All rights reserved.