public class UncheckedBytes<U> extends AbstractBytes<U>
bytesStore, DISABLE_THREAD_SAFETY, 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<U> |
append8bit(@NotNull CharSequence cs)
Appends a String to the Bytes in ISO-8859-1.
|
@NotNull Bytes<U> |
appendUtf8(char[] chars,
int offset,
int length) |
@NotNull BytesStore<Bytes<U>,U> |
copy()
Creates and returns a new copy of this Bytes object from
RandomCommon.readPosition()
to RandomCommon.readLimit() . |
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 throw an
DecoratedBufferOverflowException |
boolean |
isElastic()
Returns if this Bytes object is elastic.
|
protected long |
prewriteOffsetPositionMoved(long subtracting) |
protected void |
readCheckOffset(long offset,
long adding,
boolean given) |
@NotNull Bytes<U> |
readLimit(long limit) |
protected long |
readOffsetPositionMoved(long adding) |
@NotNull Bytes<U> |
readPosition(long position) |
@NotNull Bytes<U> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
void |
setBytes(@NotNull Bytes<?> bytes) |
boolean |
unchecked()
Returns if this Bytes object is unchecked.
|
@NotNull Bytes<U> |
unchecked(boolean unchecked)
Creates and returns a new Bytes which is optionally unchecked as indicated by the provided
unchecked . |
@NotNull Bytes<U> |
write(@NotNull BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<U> |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull Bytes<U> |
writeByte(byte i8) |
protected void |
writeCheckOffset(long offset,
long adding) |
@NotNull Bytes<U> |
writeLimit(long limit) |
protected long |
writeOffsetPositionMoved(long adding,
long advance) |
@NotNull Bytes<U> |
writePosition(long position) |
@NotNull Bytes<U> |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the writePosition.
|
@NotNull Bytes<U> |
writeUtf8(@Nullable String text) |
acquireUncheckedInput, addressForRead, addressForWrite, addressForWritePosition, append, byteCheckSum, byteCheckSum, byteCheckSum, bytesStore, bytesStore, canReadDirect, canWriteDirect, capacity, clear, clearAndPad, compact, compareAndSwapInt, compareAndSwapLong, equals, hashCode, isDirectMemory, isImmutableEmptyByteStore, 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, startsWith, testAndSetInt, toString, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, uncheckedWritePosition, underlyingObject, write, 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, singleThreadedCheckDisabled, singleThreadedCheckReset, 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, empty, forFieldGroup, from, from, fromDirect, fromHexString, 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
addAndGetDouble, addAndGetDoubleNotAtomic, addAndGetFloat, addAndGetFloatNotAtomic, addAndGetInt, addAndGetIntNotAtomic, addAndGetLong, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, bytesForWrite, charAt, cipher, cipher, compareAndSwapDouble, compareAndSwapFloat, contentEquals, elasticByteBuffer, endsWith, equalBytes, 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, 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, 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
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
DecoratedBufferOverflowException
desiredCapacity
- the capacity that you requiredIllegalStateException
- if closed and it needs a resizeIllegalArgumentException
@NotNull public @NotNull Bytes<U> unchecked(boolean unchecked)
Bytes
unchecked
.
This allows bounds checks to be turned off.
Note: this means that the result is no longer elastic, even if this
is elastic.
Note: It is only possible to go from a checked Bytes to an unchecked bytes and not vice versa.
unchecked
- if true, minimal bounds checks will be performedpublic boolean unchecked()
Bytes
An unchecked Bytes object performs little or no bounds checking
protected void writeCheckOffset(long offset, long adding)
writeCheckOffset
in class AbstractBytes<U>
protected void readCheckOffset(long offset, long adding, boolean given)
readCheckOffset
in class AbstractBytes<U>
@NotNull public @NotNull Bytes<U> readPosition(long position)
readPosition
in interface StreamingDataInput<Bytes<U>>
readPosition
in class AbstractBytes<U>
@NotNull public @NotNull Bytes<U> readLimit(long limit)
readLimit
in interface StreamingDataInput<Bytes<U>>
readLimit
in class AbstractBytes<U>
@NotNull public @NotNull Bytes<U> writePosition(long position)
writePosition
in interface StreamingDataOutput<Bytes<U>>
writePosition
in class AbstractBytes<U>
@NotNull public @NotNull Bytes<U> readSkip(long bytesToSkip)
StreamingDataInput
readSkip
in interface StreamingDataInput<Bytes<U>>
readSkip
in class AbstractBytes<U>
bytesToSkip
- bytes to skip.@NotNull public @NotNull Bytes<U> writeSkip(long bytesToSkip)
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<U>>
writeSkip
in class AbstractBytes<U>
bytesToSkip
- bytes to skip. This can be negative.@NotNull public @NotNull Bytes<U> writeLimit(long limit)
writeLimit
in interface StreamingDataOutput<Bytes<U>>
writeLimit
in class AbstractBytes<U>
@NotNull public @NotNull BytesStore<Bytes<U>,U> copy()
Bytes
RandomCommon.readPosition()
to RandomCommon.readLimit()
.public boolean isElastic()
Bytes
Bytes.realCapacity()
.protected long readOffsetPositionMoved(long adding)
readOffsetPositionMoved
in class AbstractBytes<U>
protected long writeOffsetPositionMoved(long adding, long advance)
writeOffsetPositionMoved
in class AbstractBytes<U>
protected long prewriteOffsetPositionMoved(long subtracting) throws BufferOverflowException
prewriteOffsetPositionMoved
in class AbstractBytes<U>
BufferOverflowException
@NotNull public @NotNull Bytes<U> 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<U> 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<U> 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<U> writeByte(byte i8) throws BufferOverflowException, IllegalStateException
writeByte
in interface StreamingDataOutput<Bytes<U>>
writeByte
in class AbstractBytes<U>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<U> writeUtf8(@Nullable @Nullable String text) throws BufferOverflowException, IllegalStateException
@NotNull public @NotNull Bytes<U> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
Copyright © 2022. All rights reserved.