public class UncheckedBytes<Underlying> extends AbstractBytes<Underlying>
bytesStore, isPresent, readPosition, writeLimit, writePosition
WARN_COUNT, WARN_NS
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_BYTE_BUFFER_CAPACITY, MAX_CAPACITY, MAX_HEAP_CAPACITY
charToString
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Constructor and Description |
---|
UncheckedBytes(@NotNull Bytes underlyingBytes) |
Modifier and Type | Method and Description |
---|---|
default long |
addressForRead(long offset,
int buffer) |
@NotNull Bytes<Underlying> |
append8bit(@NotNull CharSequence cs)
Append a String to the Bytes in ISO-8859-1
|
@NotNull Bytes<Underlying> |
appendUtf8(char[] chars,
int offset,
int length) |
default ByteOrder |
byteOrder() |
default boolean |
compareAndSwapDouble(long offset,
double expected,
double value)
Perform a 64-bit double CAS at a given offset.
|
default boolean |
compareAndSwapFloat(long offset,
float expected,
float value)
Perform a 32-bit float CAS at a given offset.
|
@NotNull BytesStore<Bytes<Underlying>,Underlying> |
copy() |
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()
Returns if this Bytes is elastic.
|
default void |
parse8bit(Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Appendable buffer,
@NotNull StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Bytes buffer,
@NotNull StopCharsTester stopCharsTester) |
default String |
parse8bit(@NotNull StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(StringBuilder buffer,
@NotNull StopCharsTester stopCharsTester) |
default @NotNull BigDecimal |
parseBigDecimal() |
default @Nullable Boolean |
parseBoolean() |
default @Nullable Boolean |
parseBoolean(@NotNull 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 float |
parseFloat()
parse text as a float decimal.
|
default int |
parseInt()
parse text as an int.
|
default long |
parseLong()
parse text as a long integer.
|
default long |
parseLongDecimal()
Parse the significant digits of a decimal number.
|
default void |
parseUTF(@NotNull Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
Deprecated.
|
default void |
parseUTF(@NotNull Appendable buffer,
@NotNull StopCharTester stopCharTester)
Deprecated.
|
default @NotNull String |
parseUTF(@NotNull StopCharTester stopCharTester)
Deprecated.
|
default void |
parseUtf8(@NotNull Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
parse text with UTF-8 decoding as one or two character terminated.
|
default void |
parseUtf8(@NotNull Appendable buffer,
@NotNull StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default @NotNull String |
parseUtf8(@NotNull StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
protected long |
prewriteOffsetPositionMoved(long subtracting) |
default @NotNull Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
@NotNull Bytes<Underlying> |
readLimit(long limit) |
protected long |
readOffsetPositionMoved(long adding) |
@NotNull Bytes<Underlying> |
readPosition(long position) |
default long |
readRemaining() |
@NotNull Bytes<Underlying> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
void |
setBytes(@NotNull Bytes bytes) |
default boolean |
skipTo(@NotNull StopCharTester tester)
Skip text until a terminating character is reached.
|
boolean |
unchecked() |
@NotNull Bytes<Underlying> |
unchecked(boolean unchecked)
Return a Bytes which is optionally unchecked.
|
@NotNull Bytes<Underlying> |
write(@NotNull BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<Underlying> |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<Underlying> |
writeByte(byte i8) |
@NotNull Bytes<Underlying> |
writeLimit(long limit) |
protected long |
writeOffsetPositionMoved(long adding,
long advance) |
@NotNull Bytes<Underlying> |
writePosition(long position) |
default long |
writeRemaining() |
@NotNull Bytes<Underlying> |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the writePosition.
|
@NotNull Bytes<Underlying> |
writeUtf8(String s) |
addressForRead, addressForWrite, addressForWritePosition, append, byteCheckSum, byteCheckSum, byteCheckSum, bytesStore, bytesStore, canReadDirect, canWriteDirect, capacity, clear, clearAndPad, compact, compareAndSwapInt, compareAndSwapLong, equals, hashCode, isDirectMemory, isPresent, isPresent, lastDecimalPlaces, lastDecimalPlaces, lenient, lenient, move, nativeRead, nativeRead, nativeWrite, nativeWrite, peekUnsignedByte, peekUnsignedByte, performRelease, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteShort, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLimit, readLong, readLong, readPosition, readShort, readShort, readUnsignedByte, readUnsignedByte, readVolatileByte, readVolatileInt, readVolatileInt, readVolatileLong, readVolatileLong, readVolatileShort, realCapacity, realWriteRemaining, safeCopySize, start, testAndSetInt, toString, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, underlyingObject, write, write, write, write, write, writeByte, writeDouble, writeDouble, writeDoubleAndInt, writeFloat, writeFloat, writeInt, writeInt, writeIntAdv, writeLimit, writeLong, writeLong, writeLongAdv, writeOffsetPositionMoved, writeOrderedInt, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writeShort, writeShort, writeSome, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShort
assertReferencesReleased, createdHere, disableReferenceTracing, enableReferenceTracing, performReleaseInBackground, refCount, referenceId, release, releaseLast, reserve, reservedBy, reserveTransfer, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, allocateElasticOnHeap, allocateElasticOnHeap, bytesForRead, copyTo, copyTo, directFrom, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, elasticHeapByteBuffer, from, from, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, isEqual, readBigDecimal, readBigInteger, readMarshallableLength16, readWithLength, readWrite, safeLimit, sharedMemory, toHexString, toHexString, toHexString, toString, toString, toString, unwrite, valueOf, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite, write, writeMarshallableLength16
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, bytesForWrite, charAt, cipher, cipher, contentEquals, empty, endsWith, equalBytes, inside, inside, isEmpty, length, longCheckSum, nativePointer, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, writeMaxInt, writeMaxLong, zeroOut
append, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, codePoints
bytesMethodReader, bytesMethodReaderBuilder, readObject
addAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, peekVolatileInt, printable, read, readBoolean, readIncompleteLong, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBuffer
inputStream, parseHexLong, parseUTF, parseUtf8, parseUtf8, rawReadByte, rawReadInt, rawReadLong, read, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readChar, readEnum, readHistogram, readIncompleteLong, readInt24, readLimitToCapacity, readPositionRemaining, readPositionUnlimited, readStopBit, readStopBitChar, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength, readWithLength, readWithLength0, unsafeReadObject, unsafeReadObject
bytesMethodWriter, bytesMethodWriterBuilder, writeObject
append, append, append, append, append, append, append, append, append, append8bit, append8bit, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writer
alignBy, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, unsafeWriteObject, unsafeWriteObject, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeChar, writeEnum, writeHistogram, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUTFΔ, writeWithLength
refCount, release, releaseLast, releaseLast, reserve, reservedBy, reserveTransfer, tryReserve
referenceId, referenceName, temporary
prepend
comment, indent, retainsComments
public UncheckedBytes(@NotNull @NotNull Bytes underlyingBytes) throws IllegalStateException
IllegalStateException
public void setBytes(@NotNull @NotNull Bytes bytes) throws IllegalStateException
IllegalStateException
public void ensureCapacity(long size) throws IllegalArgumentException
Bytes
BufferOverflowException
size
- the capacity that you requiredIllegalArgumentException
- if the buffer is not elastic and there is not enough space@NotNull public @NotNull Bytes<Underlying> unchecked(boolean unchecked)
Bytes
this
is elastic.unchecked
- if true, minimal bounds checks will be performed.public boolean unchecked()
@NotNull public @NotNull Bytes<Underlying> readPosition(long position)
readPosition
in class AbstractBytes<Underlying>
@NotNull public @NotNull Bytes<Underlying> readLimit(long limit)
readLimit
in class AbstractBytes<Underlying>
@NotNull public @NotNull Bytes<Underlying> writePosition(long position)
writePosition
in interface StreamingDataOutput<Bytes<Underlying>>
writePosition
in class AbstractBytes<Underlying>
@NotNull public @NotNull Bytes<Underlying> readSkip(long bytesToSkip)
StreamingDataInput
readSkip
in class AbstractBytes<Underlying>
bytesToSkip
- bytes to skip.@NotNull public @NotNull Bytes<Underlying> writeSkip(long bytesToSkip)
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<Underlying>>
writeSkip
in class AbstractBytes<Underlying>
bytesToSkip
- bytes to skip.@NotNull public @NotNull Bytes<Underlying> writeLimit(long limit)
writeLimit
in interface StreamingDataOutput<Bytes<Underlying>>
writeLimit
in class AbstractBytes<Underlying>
@NotNull public @NotNull BytesStore<Bytes<Underlying>,Underlying> copy()
public boolean isElastic()
Bytes
Bytes.realCapacity()
.protected long readOffsetPositionMoved(long adding)
readOffsetPositionMoved
in class AbstractBytes<Underlying>
protected long writeOffsetPositionMoved(long adding, long advance)
writeOffsetPositionMoved
in class AbstractBytes<Underlying>
protected long prewriteOffsetPositionMoved(long subtracting) throws BufferOverflowException
prewriteOffsetPositionMoved
in class AbstractBytes<Underlying>
BufferOverflowException
@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferOverflowException, IllegalArgumentException
StreamingDataOutput
@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, IllegalArgumentException
StreamingDataOutput
@NotNull public @NotNull Bytes<Underlying> append8bit(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException
ByteStringAppender
cs
- to writeBufferOverflowException
- If the string as too large to write in the capacity availableBufferUnderflowException
- if the capacity of the underlying buffer was exceeded@NotNull public @NotNull Bytes<Underlying> writeByte(byte i8) throws BufferOverflowException
writeByte
in interface StreamingDataOutput<Bytes<Underlying>>
writeByte
in class AbstractBytes<Underlying>
BufferOverflowException
@NotNull public @NotNull Bytes<Underlying> writeUtf8(String s) throws BufferOverflowException
BufferOverflowException
@NotNull public @NotNull Bytes<Underlying> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException
@NotNull public @NotNull Reader reader()
@Nullable public @Nullable Boolean parseBoolean(@NotNull @NotNull StopCharTester tester)
false: f, false, n, no, 0
true: t, true, y, yes, 1
tester
- to detect the end of the text.@Nullable public @Nullable Boolean parseBoolean()
@NotNull public @NotNull String parseUtf8(@NotNull @NotNull StopCharTester stopCharTester)
stopCharTester
- to check if the end has been reached.@NotNull @Deprecated public @NotNull String parseUTF(@NotNull @NotNull StopCharTester stopCharTester)
public void parseUtf8(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
@Deprecated public void parseUTF(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
BufferUnderflowException
public void parseUtf8(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
@Deprecated public void parseUTF(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public void parse8bit(Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
public String parse8bit(@NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
stopCharTester
- to check if the end has been reached.BufferUnderflowException
public void parse8bit(Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
public void parse8bit(Bytes buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
BufferUnderflowException
public void parse8bit(StringBuilder buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
BufferUnderflowException
public int parseInt() throws BufferUnderflowException
BufferUnderflowException
public long parseLong() throws BufferUnderflowException
BufferUnderflowException
public float parseFloat() throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
public double parseDouble() throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
public long parseLongDecimal() throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
public boolean skipTo(@NotNull @NotNull StopCharTester tester)
tester
- to stop at@NotNull public @NotNull BigDecimal parseBigDecimal()
public long readRemaining()
public long writeRemaining()
public long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
public boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
Copyright © 2020. All rights reserved.