public class UncheckedBytes<Underlying> extends AbstractBytes<Underlying>
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
Constructor and Description |
---|
UncheckedBytes(@NotNull Bytes underlyingBytes) |
Modifier and Type | Method and Description |
---|---|
@NotNull Bytes<Underlying> |
append8bit(@NotNull CharSequence cs)
Appends a String to the Bytes in ISO-8859-1.
|
@NotNull Bytes<Underlying> |
appendUtf8(char[] chars,
int offset,
int length) |
@NotNull BytesStore<Bytes<Underlying>,Underlying> |
copy() |
void |
ensureCapacity(long desiredCapacity)
Grows 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.
|
protected long |
prewriteOffsetPositionMoved(long subtracting) |
protected void |
readCheckOffset(long offset,
long adding,
boolean given) |
@NotNull Bytes<Underlying> |
readLimit(long limit) |
protected long |
readOffsetPositionMoved(long adding) |
@NotNull Bytes<Underlying> |
readPosition(long position) |
@NotNull Bytes<Underlying> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
void |
setBytes(@NotNull Bytes bytes) |
boolean |
unchecked() |
@NotNull Bytes<Underlying> |
unchecked(boolean unchecked)
Returns a Bytes which is optionally unchecked.
|
@NotNull Bytes<Underlying> |
write(@NotNull BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
void |
write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length)
Copy from ByteBuffer into this.
|
@NotNull Bytes<Underlying> |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<Underlying> |
writeByte(byte i8) |
protected void |
writeCheckOffset(long offset,
long adding) |
@NotNull Bytes<Underlying> |
writeLimit(long limit) |
protected long |
writeOffsetPositionMoved(long adding,
long advance) |
@NotNull Bytes<Underlying> |
writePosition(long position) |
@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, lastDecimalPlaces, lastDecimalPlaces, lastNumberHadDigits, lastNumberHadDigits, lenient, lenient, move, nativeRead, nativeWrite, peekUnsignedByte, peekUnsignedByte, performRelease, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteShort, read, read, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLimit, readLong, readLong, readPosition, readShort, readShort, readUnsignedByte, readUnsignedByte, readVolatileByte, readVolatileInt, readVolatileInt, readVolatileLong, readVolatileLong, readVolatileShort, realCapacity, safeCopySize, start, testAndSetInt, toString, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, uncheckedWritePosition, underlyingObject, write, write, write, write, write8bit, write8bit, write8bit, write8bit, 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, 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
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, allocateElasticOnHeap, allocateElasticOnHeap, bytesForRead, copyTo, copyTo, directFrom, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, elasticHeapByteBuffer, forFieldGroup, from, from, fromDirect, fromHexString, 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
addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, bytesForWrite, charAt, cipher, cipher, contentEquals, elasticByteBuffer, empty, endsWith, equalBytes, forFields, from, hash, inside, inside, isEmpty, isEqual, lazyNativeBytesStoreWithFixedCapacity, length, nativePointer, nativeStore, nativeStoreFrom, nativeStoreWithFixedCapacity, 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, readBoolean, readIncompleteLong, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBuffer
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, read, read8bit, 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, append, append8bit, append8bit, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writer
alignBy, appendUtf8, 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, writeWithLength
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 desiredCapacity) throws IllegalArgumentException, IllegalStateException
Bytes
BufferOverflowException
desiredCapacity
- the capacity that you requiredIllegalArgumentException
- if the buffer is not elastic and there is not enough spaceIllegalStateException
@NotNull public @NotNull Bytes<Underlying> unchecked(boolean unchecked)
Bytes
this
is elastic.unchecked
- if true, minimal bounds checks will be performedpublic boolean unchecked()
protected void writeCheckOffset(long offset, long adding)
writeCheckOffset
in class AbstractBytes<Underlying>
protected void readCheckOffset(long offset, long adding, boolean given)
readCheckOffset
in class AbstractBytes<Underlying>
@NotNull public @NotNull Bytes<Underlying> readPosition(long position)
readPosition
in interface StreamingDataInput<Bytes<Underlying>>
readPosition
in class AbstractBytes<Underlying>
@NotNull public @NotNull Bytes<Underlying> readLimit(long limit)
readLimit
in interface StreamingDataInput<Bytes<Underlying>>
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 interface StreamingDataInput<Bytes<Underlying>>
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()
copy
in interface Bytes<Underlying>
copy
in interface BytesStore<Bytes<Underlying>,Underlying>
copy
in class AbstractBytes<Underlying>
public boolean isElastic()
Bytes
Bytes.realCapacity()
.isElastic
in interface Bytes<Underlying>
isElastic
in class AbstractBytes<Underlying>
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, IllegalStateException, BufferUnderflowException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
@NotNull public @NotNull Bytes<Underlying> write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, IllegalArgumentException, IllegalStateException, BufferUnderflowException
StreamingDataOutput
Calling this method will update the cursors of this, but not the bytes we read from.
@NotNull public @NotNull Bytes<Underlying> append8bit(@NotNull @NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IllegalStateException
ByteStringAppender
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 exceededIllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeByte(byte i8) throws BufferOverflowException, IllegalStateException
writeByte
in interface StreamingDataOutput<Bytes<Underlying>>
writeByte
in class AbstractBytes<Underlying>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Underlying> writeUtf8(String s) throws BufferOverflowException, IllegalStateException
@NotNull public @NotNull Bytes<Underlying> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
public void write(long offsetInRDO, ByteBuffer bytes, int offset, int length) throws BufferOverflowException
RandomDataOutput
Does not update cursors e.g. writePosition()
write
in interface RandomDataOutput<Bytes<Underlying>>
write
in class AbstractBytes<Underlying>
offsetInRDO
- offset to write tobytes
- copy from bytesoffset
- copy from offsetBufferOverflowException
Copyright © 2021. All rights reserved.