public interface Bytes<Underlying> extends BytesStore<Bytes<Underlying>,Underlying>, StreamingDataInput<Bytes<Underlying>>, StreamingDataOutput<Bytes<Underlying>>, ByteStringAppender<Bytes<Underlying>>
Modifier and Type | Field and Description |
---|---|
static long |
MAX_CAPACITY |
charToString
Modifier and Type | Method and Description |
---|---|
long |
address(long offset)
Obtain the underlying address.
|
default ByteOrder |
byteOrder() |
default Bytes<Underlying> |
bytesForRead()
Creates a slice of the current Bytes based on its position() and limit().
|
S |
clear() |
BytesStore<Bytes<Underlying>,Underlying> |
copy() |
static Bytes<ByteBuffer> |
elasticByteBuffer() |
default void |
ensureCapacity(long size)
grow the buffer if the buffer is elastic, if the buffer is not elastic and there is not enough capacity then this
method will throws
BufferOverflowException |
static <B extends BytesStore<B,Underlying>,Underlying> |
expect(BytesStore<B,Underlying> bytesStore) |
static Bytes<byte[]> |
expect(String text) |
static Bytes<byte[]> |
from(String text) |
default boolean |
isClear() |
boolean |
isElastic() |
default void |
parse8bit(Appendable sb,
StopCharsTester stopCharsTester) |
default double |
parseDouble() |
default long |
parseLong() |
default void |
parseUTF(Appendable sb,
StopCharsTester stopCharsTester) |
default void |
parseUTF(Appendable sb,
StopCharTester stopCharTester) |
default String |
parseUTF(StopCharTester stopCharTester) |
default long |
readLimit() |
default long |
readPosition() |
default long |
readRemaining() |
S |
readSkip(long bytesToSkip) |
default long |
realCapacity() |
default long |
safeLimit() |
default boolean |
skipTo(StopCharTester tester) |
default long |
start() |
default String |
toHexString()
display the hex data of
Bytes from the position() to the limit() |
default String |
toHexString(long maxLength) |
static String |
toString(Bytes<?> buffer)
Creates a string from the
position to the limit , The buffer is not modified
by this call |
static String |
toString(Bytes buffer,
long position,
long len)
The buffer is not modified by this call
|
default Bytes<Underlying> |
unchecked(boolean unchecked) |
static Bytes<byte[]> |
wrapForRead(byte[] byteArray) |
static Bytes<ByteBuffer> |
wrapForRead(ByteBuffer byteBuffer) |
static Bytes<byte[]> |
wrapForWrite(byte[] byteArray) |
static Bytes<ByteBuffer> |
wrapForWrite(ByteBuffer byteBuffer) |
default long |
writeLimit() |
default long |
writePosition() |
default long |
writeRemaining() |
S |
writeSkip(long bytesToSkip) |
addAndGetInt, addAndGetLong, byteCheckSum, bytesForWrite, bytesStore, capacity, charAt, compareAndSwapInt, compareAndSwapLong, copyTo, equalBytes, getAndAddInt, inside, length, nativePointer, subSequence, toDebugString, underlyingObject, wrap, wrap, zeroOut
bytesEqual, copyTo, createCharToString, nativeRead, parseLong, printable, readBoolean, readByte, readDouble, readFloat, readIncompleteLong, readInt, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readVolatileInt, readVolatileLong
append, nativeWrite, write, write, write, write, write, writeBoolean, writeByte, writeByte, writeDouble, writeFloat, writeInt, writeLong, writeOrderedInt, writeOrderedLong, writeShort, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort
chars, codePoints, toString
inputStream, nativeRead, parseWithLength, peekUnsignedByte, read, read, readBoolean, readByte, readDouble, readFloat, readInt, readLimit, readLong, readPosition, readShort, readStopBit, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTFΔ, readUTFΔ, readVolatileInt, readVolatileLong, readWithLength
append, append, append, append, append, append, append, append8bit, appendDateMillis, appendTimeMillis
nativeWrite, outputStream, write, write, write, write, write, writeBoolean, writeByte, writeDouble, writeFloat, writeInt, writeLimit, writeLong, writeOrderedInt, writeOrderedLong, writePosition, writeShort, writeStopBit, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUTFΔ
static final long MAX_CAPACITY
static Bytes<ByteBuffer> elasticByteBuffer()
static Bytes<ByteBuffer> wrapForRead(ByteBuffer byteBuffer)
static Bytes<ByteBuffer> wrapForWrite(ByteBuffer byteBuffer)
static <B extends BytesStore<B,Underlying>,Underlying> Bytes<Underlying> expect(BytesStore<B,Underlying> bytesStore)
static Bytes<byte[]> wrapForRead(byte[] byteArray)
static Bytes<byte[]> wrapForWrite(byte[] byteArray)
default Bytes<Underlying> unchecked(boolean unchecked)
default long safeLimit()
safeLimit
in interface BytesStore<Bytes<Underlying>,Underlying>
static String toString(@NotNull Bytes<?> buffer)
position
to the limit
, The buffer is not modified
by this callbuffer
- the buffer to useposition
to the limit
static String toString(@NotNull Bytes buffer, long position, long len)
buffer
- the buffer to useposition
- the position to create the string fromlen
- the number of characters to show in the stringposition
default boolean isClear()
isClear
in interface BytesStore<Bytes<Underlying>,Underlying>
default long realCapacity()
realCapacity
in interface BytesStore<Bytes<Underlying>,Underlying>
realCapacity
in interface RandomDataInput
BytesStore<Bytes<Underlying>,Underlying> copy()
copy
in interface BytesStore<Bytes<Underlying>,Underlying>
default String toHexString()
Bytes
from the position() to the limit()default String toHexString(long maxLength)
boolean isElastic()
default void ensureCapacity(long size)
BufferOverflowException
size
- the capacity that you requiredBufferOverflowException
- if the buffer is not elastic and there is not enough spacedefault Bytes<Underlying> bytesForRead()
bytesForRead
in interface BytesStore<Bytes<Underlying>,Underlying>
default String parseUTF(StopCharTester stopCharTester)
default void parseUTF(Appendable sb, StopCharTester stopCharTester)
default void parseUTF(Appendable sb, StopCharsTester stopCharsTester)
default void parse8bit(Appendable sb, StopCharsTester stopCharsTester)
default long parseLong()
default double parseDouble()
default boolean skipTo(StopCharTester tester)
S clear()
S readSkip(long bytesToSkip)
S writeSkip(long bytesToSkip)
default long start()
default long readPosition()
default long writePosition()
default long readRemaining()
default long writeRemaining()
default long readLimit()
default long writeLimit()
long address(long offset) throws UnsupportedOperationException
offset
- within this buffer. address(start()) is the actual address of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapdefault ByteOrder byteOrder()
Copyright © 2015. All rights reserved.