U
- Underlying typepublic class VanillaBytes<U> extends AbstractBytes<U> implements Byteable<Bytes<U>,U>, Comparable<CharSequence>
bytesStore, isPresent, readPosition, writeLimit, writePosition
referenceCounted, WARN_COUNT, WARN_NS
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_CAPACITY, MAX_HEAP_CAPACITY
charToString
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Modifier | Constructor and Description |
---|---|
protected |
VanillaBytes(@NotNull BytesStore bytesStore) |
protected |
VanillaBytes(@NotNull BytesStore bytesStore,
long writePosition,
long writeLimit) |
Modifier and Type | Method and Description |
---|---|
@NotNull VanillaBytes |
append(@NotNull CharSequence str,
int start,
int end)
Appends a portion of a string to the Bytes in UTF-8.
|
@NotNull Bytes<U> |
append8bit(@NotNull BytesStore bs)
Appends a BytesStore to this in ISO-8859-1.
|
@NotNull Bytes<U> |
append8bit(@NotNull CharSequence cs)
Appends a String to the Bytes in ISO-8859-1.
|
@NotNull Bytes<U> |
append8bit(@NotNull String cs)
Appends a string to this Bytes in ISO-8859-1 format.
|
protected @NotNull Bytes<U> |
append8bit0(@NotNull CharSequence cs) |
@NotNull Bytes<U> |
appendUtf8(char[] chars,
int offset,
int length) |
@NotNull VanillaBytes |
appendUtf8(@NotNull CharSequence str) |
int |
byteCheckSum(int start,
int end) |
@NotNull Bytes<U> |
bytesForRead()
Creates and returns a new slice of this Bytes object whereby the start is moved to the readPosition and the
current limit determines the capacity.
|
void |
bytesStore(@NotNull BytesStore<Bytes<U>,U> byteStore,
long offset,
long length)
This setter for a data type which points to an underlying ByteStore.
|
int |
compareTo(@NotNull CharSequence cs) |
@NotNull BytesStore<Bytes<U>,U> |
copy()
Creates and returns a new copy of this Bytes object from
RandomCommon.readPosition()
to RandomCommon.readLimit() . |
boolean |
equalBytes(@NotNull BytesStore bytesStore,
long length)
Returns if a portion of a specified BytesStore matches this BytesStore.
|
boolean |
isElastic()
Returns if this Bytes object is elastic.
|
boolean |
isEqual(@Nullable String other)
Returns if this Bytes object contents equals the provided
other . |
long |
maxSize() |
long |
offset() |
protected void |
optimisedWrite(@NotNull RandomDataInput bytes,
long offset,
long length) |
int |
read(byte[] bytes) |
void |
read8Bit(char[] chars,
int length) |
long |
readVolatileLong(long offset)
Read a 64-bit long from memory with a load barrier.
|
long |
realCapacity()
Returns the actual capacity that can be potentially read.
|
@NotNull String |
toString() |
protected @NotNull String |
toString0() |
ByteBuffer |
toTemporaryDirectByteBuffer() |
static @NotNull VanillaBytes<Void> |
vanillaBytes()
Return a VanillaBytes which can have it's bytesStore() replaced as needed.
|
@NotNull Bytes<U> |
write(@NotNull BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
void |
write(long position,
@NotNull CharSequence str,
int offset,
int length) |
@NotNull Bytes<U> |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
acquireUncheckedInput, addressForRead, addressForWrite, addressForWritePosition, append, byteCheckSum, byteCheckSum, bytesStore, bytesStore, canReadDirect, canWriteDirect, capacity, clear, clearAndPad, compact, compareAndSwapInt, compareAndSwapLong, equals, hashCode, isDirectMemory, lastDecimalPlaces, lastDecimalPlaces, lastNumberHadDigits, lastNumberHadDigits, lenient, lenient, move, nativeRead, nativeWrite, peekUnsignedByte, peekUnsignedByte, performRelease, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteOffsetPositionMoved, prewriteShort, read, read, readByte, readByte, readCheckOffset, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLimit, readLimit, readLong, readLong, readOffsetPositionMoved, readPosition, readPosition, readShort, readShort, readSkip, readUnsignedByte, readUnsignedByte, readVolatileByte, readVolatileInt, readVolatileInt, readVolatileLong, readVolatileShort, safeCopySize, start, startsWith, testAndSetInt, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, uncheckedWritePosition, underlyingObject, write, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeByte, writeByte, writeCheckOffset, writeDouble, writeDouble, writeDoubleAndInt, writeFloat, writeFloat, writeInt, writeInt, writeIntAdv, writeLimit, writeLimit, writeLong, writeLong, writeLongAdv, writeOffsetPositionMoved, writeOffsetPositionMoved, writeOrderedInt, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writePosition, writeShort, writeShort, writeSkip, writeSome, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShort
assertReferencesReleased, backgroundPerformRelease, canReleaseInBackground, clearUsedByThread, createdHere, disableReferenceTracing, enableReferenceTracing, refCount, referenceId, release, releaseLast, reserve, reservedBy, reserveTransfer, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
address, bytesStore, lock, tryLock
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, allocateElasticOnHeap, allocateElasticOnHeap, copyTo, copyTo, directFrom, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, elasticHeapByteBuffer, ensureCapacity, forFieldGroup, from, from, fromDirect, fromHexString, indexOf, indexOf, isClear, readBigDecimal, readBigInteger, readMarshallableLength16, readWithLength, readWrite, safeLimit, sharedMemory, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, unwrite, valueOf, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite, write, writeMarshallableLength16
addAndGetDouble, addAndGetDoubleNotAtomic, addAndGetFloat, addAndGetFloatNotAtomic, addAndGetInt, addAndGetIntNotAtomic, addAndGetLong, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, bytesForWrite, charAt, cipher, cipher, compareAndSwapDouble, compareAndSwapFloat, contentEquals, elasticByteBuffer, empty, endsWith, forFields, from, hash, inside, inside, isEmpty, isEqual, lazyNativeBytesStoreWithFixedCapacity, length, nativePointer, nativeStore, nativeStoreFrom, nativeStoreWithFixedCapacity, 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
canReadDirect, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, peekVolatileInt, printable, readBoolean, readIncompleteLong, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray
parse8bit, parse8bit, parse8bit, parse8bit, parse8bit, parseBigDecimal, parseBoolean, parseBoolean, parseDouble, parseFlexibleLong, parseFloat, parseInt, parseLong, parseLongDecimal, parseUtf8, parseUtf8, parseUtf8, reader, skipTo
inputStream, parseHexLong, parseUtf8, parseUtf8, rawReadByte, rawReadInt, rawReadLong, read, read, read, read, read8bit, read8bit, read8bit, readBoolean, readChar, readEnum, readHistogram, readIncompleteLong, readInt24, readLimitToCapacity, readPositionForHeader, readPositionRemaining, readPositionUnlimited, readStopBit, readStopBitChar, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUtf8, readUtf8, readWithLength, readWithLength, readWithLength0, unsafeRead, unsafeReadObject, unsafeReadObject
bytesMethodWriter, writeObject
append, append, append, append, append, append, append, append, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writer
appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, unsafeWrite, unsafeWriteObject, unsafeWriteObject, write, write, write, write, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeChar, writeEnum, writeHistogram, writeInt24, writePositionForHeader, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUtf8, writeWithLength
prepend
comment, indent, retainsComments
protected VanillaBytes(@NotNull @NotNull BytesStore bytesStore) throws IllegalStateException, IllegalArgumentException
protected VanillaBytes(@NotNull @NotNull BytesStore bytesStore, long writePosition, long writeLimit) throws IllegalStateException, IllegalArgumentException
@NotNull public static @NotNull VanillaBytes<Void> vanillaBytes()
public long readVolatileLong(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileLong
in interface RandomDataInput
readVolatileLong
in class AbstractBytes<U>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
- if releasedpublic void bytesStore(@NotNull @NotNull BytesStore<Bytes<U>,U> byteStore, long offset, long length) throws IllegalStateException, IllegalArgumentException, BufferUnderflowException
Byteable
bytesStore
in interface Byteable<Bytes<U>,U>
byteStore
- the fix point ByteStoreoffset
- the offset within the ByteStorelength
- the length in the ByteStoreIllegalStateException
IllegalArgumentException
BufferUnderflowException
public long offset()
public long maxSize()
public boolean isElastic()
Bytes
Bytes.realCapacity()
.@NotNull public @NotNull Bytes<U> bytesForRead() throws IllegalStateException
Bytes
As a sub-section of a Bytes, it cannot be elastic.
bytesForRead
in interface Bytes<U>
bytesForRead
in interface BytesStore<Bytes<U>,U>
IllegalStateException
- if the underlying BytesStore has been releasedpublic boolean isEqual(@Nullable @Nullable String other) throws IllegalStateException
Bytes
other
.isEqual
in interface Bytes<U>
other
- to test for equality, nullableother
IllegalStateException
- if this Bytes object has been previously releasedpublic long realCapacity()
RandomDataInput
realCapacity
in interface Bytes<U>
realCapacity
in interface BytesStore<Bytes<U>,U>
realCapacity
in interface RandomDataInput
realCapacity
in interface StreamingDataOutput<Bytes<U>>
realCapacity
in class AbstractBytes<U>
@NotNull public @NotNull BytesStore<Bytes<U>,U> copy() throws IllegalStateException
Bytes
RandomCommon.readPosition()
to RandomCommon.readLimit()
.copy
in interface Bytes<U>
copy
in interface BytesStore<Bytes<U>,U>
copy
in class AbstractBytes<U>
IllegalStateException
@NotNull public @NotNull Bytes<U> write(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException, IllegalArgumentException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
write
in interface StreamingDataOutput<Bytes<U>>
BufferOverflowException
BufferUnderflowException
IllegalStateException
IllegalArgumentException
protected void optimisedWrite(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException, IllegalArgumentException
public void write(long position, @NotNull @NotNull CharSequence str, int offset, int length) throws BufferOverflowException, IllegalArgumentException, ArithmeticException, IllegalStateException, BufferUnderflowException
@NotNull public @NotNull VanillaBytes append(@NotNull @NotNull CharSequence str, int start, int end) throws IndexOutOfBoundsException
ByteStringAppender
append
in interface Appendable
append
in interface ByteStringAppender<Bytes<U>>
str
- the CharacterSequence to appendstart
- index of the first char inclusiveend
- index of the last char exclusiveIndexOutOfBoundsException
- if the specified indexes are out of range@NotNull public @NotNull VanillaBytes appendUtf8(@NotNull @NotNull CharSequence str) throws BufferOverflowException
appendUtf8
in interface StreamingDataOutput<Bytes<U>>
BufferOverflowException
@NotNull public @NotNull Bytes<U> append8bit(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IllegalStateException
ByteStringAppender
append8bit
in interface ByteStringAppender<Bytes<U>>
cs
- the CharSequence to appendBufferOverflowException
- if the string is too large to write in the capacity availableBufferUnderflowException
- if the capacity of the underlying buffer was exceededIndexOutOfBoundsException
IllegalStateException
@NotNull public @NotNull Bytes<U> append8bit(@NotNull @NotNull BytesStore bs) throws BufferOverflowException, BufferUnderflowException, IllegalStateException
ByteStringAppender
append8bit
in interface ByteStringAppender<Bytes<U>>
bs
- the specified BytesStore to appendBufferOverflowException
- if the BytesStore is too large to write in the capacity availableBufferUnderflowException
- if the capacity of the underlying buffer was exceededIllegalStateException
- if the BytesStore is closed@NotNull public @NotNull Bytes<U> write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException, IllegalArgumentException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
write
in interface StreamingDataOutput<Bytes<U>>
BufferOverflowException
BufferUnderflowException
IllegalStateException
IllegalArgumentException
@NotNull public @NotNull Bytes<U> append8bit(@NotNull @NotNull String cs) throws BufferOverflowException, IllegalStateException
ByteStringAppender
append8bit
in interface ByteStringAppender<Bytes<U>>
cs
- the specified string to appendBufferOverflowException
- if the string is too large to write in the capacity availableIllegalStateException
- if the underlying BytesStore is closed@NotNull public @NotNull String toString()
toString
in interface CharSequence
toString
in class AbstractBytes<U>
@NotNull protected @NotNull String toString0() throws IllegalStateException
IllegalStateException
@NotNull protected @NotNull Bytes<U> append8bit0(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, IllegalStateException
public boolean equalBytes(@NotNull @NotNull BytesStore bytesStore, long length) throws BufferUnderflowException, IllegalStateException
BytesStore
equalBytes
in interface BytesStore<Bytes<U>,U>
bytesStore
- the BytesStore to match againstlength
- the length to matchtrue
if the bytes up to min(length, this.length(), bytesStore.length()) matched.BufferUnderflowException
IllegalStateException
public void read8Bit(char[] chars, int length) throws BufferUnderflowException, IllegalStateException
public int byteCheckSum(int start, int end) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
byteCheckSum
in class AbstractBytes<U>
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
@NotNull public @NotNull Bytes<U> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalStateException, BufferUnderflowException, IllegalArgumentException
appendUtf8
in interface StreamingDataOutput<Bytes<U>>
BufferOverflowException
IllegalStateException
BufferUnderflowException
IllegalArgumentException
public ByteBuffer toTemporaryDirectByteBuffer() throws IllegalArgumentException, ArithmeticException, IllegalStateException
toTemporaryDirectByteBuffer
in interface RandomDataInput
IllegalArgumentException
ArithmeticException
IllegalStateException
public int read(byte[] bytes) throws BufferUnderflowException, IllegalStateException
read
in interface StreamingDataInput<Bytes<U>>
BufferUnderflowException
IllegalStateException
public int compareTo(@NotNull @NotNull CharSequence cs)
compareTo
in interface Comparable<CharSequence>
Copyright © 2022. All rights reserved.