public class NativeBytes<Underlying> extends VanillaBytes<Underlying>
bytesStore, isPresent, readPosition, writeLimit, writePositionDEFAULT_BYTE_BUFFER_CAPACITY, MAX_CAPACITYcharToString| Modifier and Type | Method and Description |
|---|---|
long |
capacity() |
static BytesStore<Bytes<Void>,Void> |
copyOf(Bytes bytes) |
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 |
boolean |
isElastic() |
static NativeBytes<Void> |
nativeBytes() |
static NativeBytes<Void> |
nativeBytes(long initialCapacity) |
default void |
parse8bit(Appendable buffer,
StopCharsTester stopCharsTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Appendable buffer,
StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default Boolean |
parseBoolean(StopCharTester tester)
Return true or false, or null if it could not be detected
as true or false.
|
default double |
parseDouble()
parse text as a double decimal.
|
default long |
parseLong()
parse text as a long integer.
|
default long |
parseLongDecimal()
Parse the significant digits of a decimal number.
|
default void |
parseUTF(Appendable buffer,
StopCharsTester stopCharsTester)
Deprecated.
|
default void |
parseUTF(Appendable buffer,
StopCharTester stopCharTester)
Deprecated.
|
default String |
parseUTF(StopCharTester stopCharTester)
Deprecated.
|
default void |
parseUtf8(Appendable buffer,
StopCharsTester stopCharsTester)
parse text with UTF-8 decoding as one or two character terminated.
|
default void |
parseUtf8(Appendable buffer,
StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default String |
parseUtf8(StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
byte |
readVolatileByte(long offset)
Read a 8-bit byte from memory with a load barrier.
|
int |
readVolatileInt(long offset)
Read a 32-bit int from memory with a load barrier.
|
long |
readVolatileLong(long offset)
Read a 64-bit long from memory with a load barrier.
|
short |
readVolatileShort(long offset)
Read a 16-bit short from memory with a load barrier.
|
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
Bytes<Underlying> |
write(byte[] bytes,
int offset,
int length)
Write all data or fail.
|
Bytes<Underlying> |
write(BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
protected void |
writeCheckOffset(long offset,
long adding) |
append, append8bit, append8bit, append8bit0, appendUtf8, appendUtf8, byteCheckSum, bytesForRead, bytesStore, copy, equalBytes, isEqual, maxSize, offset, read, read8Bit, realCapacity, toString, toString0, toTemporaryDirectByteBuffer, vanillaBytes, writeaddress, bytesStore, clear, clearAndPad, compact, compareAndSwapInt, compareAndSwapLong, equals, equalsBytes, hashCode, isPresent, isPresent, lastDecimalPlaces, lastDecimalPlaces, move, nativeRead, nativeRead, nativeWrite, nativeWrite, peekUnsignedByte, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteOffsetPositionMoved, prewriteShort, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLimit, readLimit, readLong, readLong, readOffsetPositionMoved, readPosition, readPosition, readShort, readShort, readSkip, readUnsignedByte, readVolatileInt, readVolatileLong, refCount, release, reserve, start, underlyingObject, write, write, write, writeByte, writeByte, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLimit, writeLimit, writeLong, writeLong, writeOffsetPositionMoved, writeOrderedInt, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writePosition, writeShort, writeShort, writeSkip, writeSome, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShortclone, finalize, getClass, notify, notifyAll, wait, wait, waitbytesStoreallocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, copyTo, copyTo, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, expect, expect, from, fromHexString, isClear, isEmpty, safeLimit, sharedMemory, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, wrapForRead, wrapForRead, wrapForRead, wrapForWrite, wrapForWriteaddAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, bytesForWrite, charAt, contentEquals, empty, endsWith, inside, isNative, length, longCheckSum, nativePointer, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, wrap, writeMaxLong, zeroOutaddAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, printable, read, readBoolean, readIncompleteLong, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArrayappend, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloatchars, codePointsinputStream, parseHexLong, parseUTF, parseUtf8, parseWithLength, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readEnum, readPositionRemaining, readStopBit, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLengthappend, append, append, append, append, append, append8bit, appendBase, appendDateMillis, appendDecimal, appendTimeMillis, writerappendUtf8, appendUtf8, copyFrom, outputStream, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBoolean, writeEnum, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8, writeUTFΔprepend@NotNull public static NativeBytes<Void> nativeBytes()
@NotNull public static NativeBytes<Void> nativeBytes(long initialCapacity) throws IllegalArgumentException
IllegalArgumentExceptionpublic static BytesStore<Bytes<Void>,Void> copyOf(@NotNull Bytes bytes)
public long capacity()
capacity in interface BytesStore<Bytes<Underlying>,Underlying>capacity in class AbstractBytes<Underlying>protected void writeCheckOffset(long offset,
long adding)
throws BufferOverflowException,
IllegalArgumentException,
net.openhft.chronicle.core.io.IORuntimeException
BufferOverflowExceptionIllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic void ensureCapacity(long size)
throws IllegalArgumentException,
net.openhft.chronicle.core.io.IORuntimeException
BytesBufferOverflowExceptionsize - the capacity that you requiredIllegalArgumentException - if the buffer is not elastic and there is not enough spaceIORuntimeException - if an error occured trying to resize the underlying buffer.net.openhft.chronicle.core.io.IORuntimeExceptionpublic byte readVolatileByte(long offset)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the BytesIORuntimeException - if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeExceptionpublic short readVolatileShort(long offset)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the BytesIORuntimeException - if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeExceptionpublic int readVolatileInt(long offset)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the BytesIORuntimeException - if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeExceptionpublic long readVolatileLong(long offset)
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException
RandomDataInputoffset - to readBufferUnderflowException - if the offset is outside the limits of the BytesIORuntimeException - if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeExceptionpublic boolean isElastic()
isElastic in interface Bytes<Underlying>isElastic in class VanillaBytes<Underlying>@NotNull public Bytes<Underlying> write(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
StreamingDataOutputwrite in interface StreamingDataOutput<Bytes<Underlying>>write in class AbstractBytes<Underlying>BufferOverflowExceptionIllegalArgumentExceptionnet.openhft.chronicle.core.io.IORuntimeException@NotNull public Bytes<Underlying> write(BytesStore bytes, long offset, long length) throws BufferOverflowException, IllegalArgumentException, BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
StreamingDataOutputwrite in interface StreamingDataOutput<Bytes<Underlying>>write in class VanillaBytes<Underlying>BufferOverflowExceptionIllegalArgumentExceptionBufferUnderflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic Reader reader()
public Boolean parseBoolean(@NotNull StopCharTester tester)
false: f, false, n, no, 0
true: t, true, y, yes, 1
tester - to detect the end of the text.@NotNull public String parseUtf8(@NotNull StopCharTester stopCharTester)
stopCharTester - to check if the end has been reached.@Deprecated public String parseUTF(@NotNull StopCharTester stopCharTester)
public void parseUtf8(@NotNull
Appendable buffer,
@NotNull
StopCharTester stopCharTester)
buffer - to populatestopCharTester - to check if the end has been reached.@Deprecated public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharTester stopCharTester)
public void parseUtf8(@NotNull
Appendable buffer,
@NotNull
StopCharsTester stopCharsTester)
throws BufferUnderflowException,
BufferOverflowException,
net.openhft.chronicle.core.io.IORuntimeException
buffer - to populatestopCharsTester - to check if the end has been reached.BufferUnderflowExceptionBufferOverflowExceptionnet.openhft.chronicle.core.io.IORuntimeException@Deprecated public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowExceptionBufferOverflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic void parse8bit(Appendable buffer, @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
buffer - to populatestopCharTester - to check if the end has been reached.BufferUnderflowExceptionBufferOverflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic void parse8bit(Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
buffer - to populatestopCharsTester - to check if the end has been reached.BufferUnderflowExceptionBufferOverflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic long parseLong()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic double parseDouble()
throws BufferUnderflowException,
net.openhft.chronicle.core.io.IORuntimeException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic long parseLongDecimal()
throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowExceptionpublic boolean skipTo(@NotNull
StopCharTester tester)
throws net.openhft.chronicle.core.io.IORuntimeException
tester - to stop atnet.openhft.chronicle.core.io.IORuntimeExceptionCopyright © 2016. All rights reserved.