public class MappedBytes extends AbstractBytes<Void> implements net.openhft.chronicle.core.io.Closeable, net.openhft.chronicle.core.io.ManagedCloseable
NOTE These Bytes are single Threaded as are all Bytes.
isPresent, readPosition, writeLimit, writePosition
referenceCounted, 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
Modifier | Constructor and Description |
---|---|
protected |
MappedBytes(@NotNull MappedFile mappedFile) |
protected |
MappedBytes(@NotNull MappedFile mappedFile,
String name) |
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
This single-argument version of the call returns an address which is guarateed safe for a contiguous
read up to the overlap size.
|
long |
addressForRead(long offset,
int buffer)
This two-argument version of the call returns an address which is guaranteed safe for a contiguous
read up to the requested buffer size.
|
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
@NotNull Bytes<Void> |
append8bit(@NotNull CharSequence cs,
int start,
int end)
Append a portion of a String to the Bytes in ISO-8859-1
|
@NotNull Bytes<Void> |
appendUtf8(char[] chars,
int offset,
int length) |
@NotNull Bytes<Void> |
appendUtf8(@NotNull CharSequence cs,
int start,
int length) |
@NotNull MappedBytesStore |
bytesStore() |
protected void |
bytesStore(BytesStore bytesStore) |
long |
capacity() |
@NotNull Bytes<Void> |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
void |
clearUsedByThread() |
void |
close() |
boolean |
compareAndSwapLong(long offset,
long expected,
long value)
Perform a 64-bit CAS at a given offset.
|
BytesStore<Bytes<Void>,Void> |
copy() |
MappedBytes |
disableThreadSafetyCheck(boolean disableThreadSafetyCheck) |
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 |
isBackingFileReadOnly() |
boolean |
isClosed() |
boolean |
isDirectMemory() |
boolean |
isElastic()
Returns if this Bytes is elastic.
|
static @NotNull MappedBytes |
mappedBytes(@NotNull File file,
long chunkSize) |
static @NotNull MappedBytes |
mappedBytes(@NotNull File file,
long chunkSize,
long overlapSize) |
static @NotNull MappedBytes |
mappedBytes(@NotNull File file,
long chunkSize,
long overlapSize,
boolean readOnly) |
static @NotNull MappedBytes |
mappedBytes(@NotNull MappedFile rw) |
static @NotNull MappedBytes |
mappedBytes(@NotNull String filename,
long chunkSize) |
@NotNull MappedFile |
mappedFile() |
int |
peekUnsignedByte() |
int |
peekUnsignedByte(long offset)
Read an unsigned byte at an offset, or -1
|
int |
peekVolatileInt() |
protected void |
performRelease() |
protected boolean |
performReleaseInBackground() |
@Nullable String |
read8bit() |
protected void |
readCheckOffset(long offset,
long adding,
boolean given) |
Bytes<Void> |
readLimitToCapacity() |
static @NotNull MappedBytes |
readOnly(@NotNull File file) |
@NotNull Bytes<Void> |
readPosition(long position) |
@NotNull Bytes<Void> |
readPositionRemaining(long position,
long remaining) |
@NotNull Bytes<Void> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
long |
readStopBit() |
char |
readStopBitChar() |
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.
|
long |
realCapacity()
Returns the actual capacity that can be potentially read.
|
long |
realReadRemaining() |
long |
realWriteRemaining() |
void |
release(net.openhft.chronicle.core.io.ReferenceOwner id) |
void |
releaseLast(net.openhft.chronicle.core.io.ReferenceOwner id) |
void |
setNewChunkListener(NewChunkListener listener) |
boolean |
sharedMemory() |
long |
start() |
void |
throwExceptionIfClosed() |
@NotNull String |
toString() |
void |
warnAndCloseIfNotClosed() |
@NotNull MappedBytes |
write(@NotNull byte[] bytes,
int offset,
int length)
Write all data or fail.
|
@NotNull Bytes<Void> |
write(@NotNull BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull MappedBytes |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
@NotNull MappedBytes |
write(long offsetInRDO,
@NotNull RandomDataInput bytes) |
@NotNull MappedBytes |
write(long writeOffset,
RandomDataInput bytes,
long readOffset,
long length) |
@NotNull MappedBytes |
write(@NotNull RandomDataInput bytes)
Write all data or fail.
|
@NotNull Bytes<Void> |
write(@NotNull RandomDataInput bytes,
long offset,
long length)
Write all data or fail.
|
@NotNull MappedBytes |
write8bit(@NotNull CharSequence s,
int start,
int length) |
@NotNull Bytes<Void> |
writeByte(byte i8) |
protected void |
writeCheckOffset(long offset,
long adding) |
@NotNull Bytes<Void> |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
@NotNull Bytes<Void> |
writePosition(long position) |
@NotNull Bytes<Void> |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the writePosition.
|
@NotNull Bytes<Void> |
writeStopBit(char n) |
@NotNull Bytes<Void> |
writeStopBit(long n)
Write a stop bit encoded long
|
@NotNull Bytes<Void> |
writeUtf8(CharSequence str)
Write the same encoding as
writeUTF with the following changes. |
@NotNull Bytes<Void> |
writeUtf8(String str) |
addressForWritePosition, append, byteCheckSum, byteCheckSum, byteCheckSum, canReadDirect, canWriteDirect, clearAndPad, compact, compareAndSwapInt, equals, hashCode, lastDecimalPlaces, lastDecimalPlaces, lastNumberHadDigits, lastNumberHadDigits, lenient, lenient, move, nativeRead, nativeWrite, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteOffsetPositionMoved, prewriteShort, read, read, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLimit, readLimit, readLong, readLong, readOffsetPositionMoved, readPosition, readShort, readShort, readUnsignedByte, readUnsignedByte, readVolatileInt, readVolatileLong, safeCopySize, testAndSetInt, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, uncheckedWritePosition, underlyingObject, write, write8bit, write8bit, write8bit, write8bit, writeByte, writeDouble, writeDouble, writeDoubleAndInt, writeFloat, writeFloat, writeInt, writeInt, writeIntAdv, writeLimit, writeLimit, writeLong, writeLong, writeLongAdv, writeOffsetPositionMoved, writeOffsetPositionMoved, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writeShort, writeShort, writeSome, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShort
assertReferencesReleased, createdHere, disableReferenceTracing, enableReferenceTracing, refCount, referenceId, reserve, reservedBy, reserveTransfer, threadSafetyCheck, throwExceptionIfNotReleased, throwExceptionIfReleased, tryReserve, unmonitor, warnAndReleaseIfNotReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
closeQuietly, closeQuietly, notifyClosing
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, allocateElasticOnHeap, allocateElasticOnHeap, bytesForRead, copyTo, copyTo, directFrom, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, elasticHeapByteBuffer, forFieldGroup, from, from, fromDirect, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, isEqual, readBigDecimal, readBigInteger, readMarshallableLength16, readWithLength, readWrite, safeLimit, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, 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, 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, printable, readBoolean, readIncompleteLong, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBuffer
parse8bit, parse8bit, parse8bit, parse8bit, parse8bit, parseBigDecimal, parseBoolean, parseBoolean, parseDouble, parseFloat, parseInt, parseLong, parseLongDecimal, parseUTF, parseUTF, parseUTF, parseUtf8, parseUtf8, parseUtf8, reader, skipTo
inputStream, parseHexLong, parseUTF, parseUtf8, parseUtf8, rawReadByte, rawReadInt, rawReadLong, read, read, read, read, read, read8bit, read8bit, read8bit, readBoolean, readChar, readEnum, readHistogram, readIncompleteLong, readInt24, readPositionForHeader, readPositionUnlimited, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUtf8, readUtf8, readUTFΔ, readUTFΔ, 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, copyFrom, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, unsafeWrite, unsafeWriteObject, unsafeWriteObject, write, write, write, write, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeChar, writeEnum, writeHistogram, writeInt24, writePositionForHeader, writePositionRemaining, writeSome, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUTFΔ, writeWithLength
prepend
comment, indent, retainsComments
protected MappedBytes(@NotNull @NotNull MappedFile mappedFile) throws IllegalStateException
IllegalStateException
protected MappedBytes(@NotNull @NotNull MappedFile mappedFile, String name) throws IllegalStateException
IllegalStateException
public void clearUsedByThread()
clearUsedByThread
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
@NotNull public static @NotNull MappedBytes mappedBytes(@NotNull @NotNull String filename, long chunkSize) throws FileNotFoundException, IllegalStateException
@NotNull public static @NotNull MappedBytes mappedBytes(@NotNull @NotNull File file, long chunkSize) throws FileNotFoundException, IllegalStateException
@NotNull public static @NotNull MappedBytes mappedBytes(@NotNull @NotNull File file, long chunkSize, long overlapSize) throws FileNotFoundException, IllegalStateException
@NotNull public static @NotNull MappedBytes mappedBytes(@NotNull @NotNull File file, long chunkSize, long overlapSize, boolean readOnly) throws FileNotFoundException, IllegalStateException
@NotNull public static @NotNull MappedBytes mappedBytes(@NotNull @NotNull MappedFile rw) throws IllegalStateException
IllegalStateException
@NotNull public static @NotNull MappedBytes readOnly(@NotNull @NotNull File file) throws FileNotFoundException
FileNotFoundException
protected void bytesStore(BytesStore bytesStore)
bytesStore
in class AbstractBytes<Void>
@NotNull public @NotNull String toString()
toString
in interface CharSequence
toString
in class AbstractBytes<Void>
@NotNull public @NotNull MappedBytes write(@NotNull @NotNull byte[] bytes, int offset, int length) throws IllegalStateException, BufferOverflowException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
IllegalStateException
BufferOverflowException
@NotNull public @NotNull MappedBytes write(long offsetInRDO, byte[] bytes, int offset, int length) throws IllegalStateException, BufferOverflowException
write
in interface RandomDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
IllegalStateException
BufferOverflowException
@NotNull public @NotNull MappedBytes write(long writeOffset, RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalStateException
write
in interface RandomDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
BufferOverflowException
BufferUnderflowException
IllegalStateException
@NotNull public @NotNull MappedBytes write(@NotNull @NotNull RandomDataInput bytes) throws IllegalStateException, BufferOverflowException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
IllegalStateException
BufferOverflowException
@NotNull public @NotNull MappedBytes write(long offsetInRDO, @NotNull @NotNull RandomDataInput bytes) throws BufferOverflowException, IllegalStateException
public void setNewChunkListener(NewChunkListener listener)
@NotNull public @NotNull MappedFile mappedFile()
public BytesStore<Bytes<Void>,Void> copy() throws IllegalStateException
copy
in interface Bytes<Void>
copy
in interface BytesStore<Bytes<Void>,Void>
copy
in class AbstractBytes<Void>
IllegalStateException
public long capacity()
capacity
in interface BytesStore<Bytes<Void>,Void>
capacity
in class AbstractBytes<Void>
public Bytes<Void> readLimitToCapacity()
readLimitToCapacity
in interface StreamingDataInput<Bytes<Void>>
public long realReadRemaining()
public long realWriteRemaining()
realWriteRemaining
in class AbstractBytes<Void>
public long realCapacity()
RandomDataInput
realCapacity
in interface Bytes<Void>
realCapacity
in interface BytesStore<Bytes<Void>,Void>
realCapacity
in interface RandomDataInput
realCapacity
in interface StreamingDataOutput<Bytes<Void>>
realCapacity
in class AbstractBytes<Void>
@NotNull public @NotNull Bytes<Void> readPositionRemaining(long position, long remaining) throws BufferUnderflowException, IllegalStateException
readPositionRemaining
in interface StreamingDataInput<Bytes<Void>>
BufferUnderflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> readPosition(long position) throws BufferUnderflowException, IllegalStateException
readPosition
in interface StreamingDataInput<Bytes<Void>>
readPosition
in class AbstractBytes<Void>
BufferUnderflowException
IllegalStateException
public long addressForRead(long offset) throws BufferUnderflowException, IllegalStateException
NOTE: If called with an offset which is already in the overlap region this call with therefore prompt a remapping to the new segment, which in turn may unmap the current segment. Any other handles using data in the current segment may therefore result in a memory violation when next used.
If manipulating offsets which may reside in the overlap region, always use the 2-argument version below
addressForRead
in class AbstractBytes<Void>
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.BufferUnderflowException
- if the offset is before the start() or the after the capacity()IllegalStateException
public long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
NOTE: In contrast to the single-argument version this call will not prompt a remapping if called within the overlap region (provided the full extent remains in the overlap region)
This version is therefore safe to use cooperatively with other handles in a defined sequence of bytes (eg returned from a DocumentContext) regardless of whether the handles span the overlap region
public long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException, IllegalStateException
addressForWrite
in class AbstractBytes<Void>
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferOverflowException
- if the offset is before the start() or the after the capacity()IllegalStateException
protected void readCheckOffset(long offset, long adding, boolean given) throws BufferUnderflowException, IllegalStateException
@Nullable public @Nullable String read8bit() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException, IllegalStateException, ArithmeticException
read8bit
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
IllegalStateException
ArithmeticException
protected void writeCheckOffset(long offset, long adding) throws BufferOverflowException, IllegalStateException
public void ensureCapacity(long desiredCapacity) throws IllegalArgumentException, IllegalStateException
Bytes
BufferOverflowException
ensureCapacity
in interface Bytes<Void>
desiredCapacity
- the capacity that you requiredIllegalArgumentException
- if the buffer is not elastic and there is not enough spaceIllegalStateException
@NotNull public @NotNull Bytes<Void> writeSkip(long bytesToSkip) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<Void>>
writeSkip
in class AbstractBytes<Void>
bytesToSkip
- bytes to skip. This can be negative.BufferOverflowException
- if the offset is outside the limits of the BytesIllegalStateException
@NotNull public @NotNull Bytes<Void> readSkip(long bytesToSkip) throws BufferUnderflowException, IllegalStateException
StreamingDataInput
readSkip
in interface StreamingDataInput<Bytes<Void>>
readSkip
in class AbstractBytes<Void>
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
@NotNull public @NotNull MappedBytesStore bytesStore()
bytesStore
in interface Bytes<Void>
bytesStore
in interface BytesStore<Bytes<Void>,Void>
bytesStore
in class AbstractBytes<Void>
public long start()
start
in class AbstractBytes<Void>
@NotNull public @NotNull Bytes<Void> writePosition(long position) throws BufferOverflowException
writePosition
in interface StreamingDataOutput<Bytes<Void>>
writePosition
in class AbstractBytes<Void>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> clear() throws IllegalStateException
StreamingCommon
clear
in interface Bytes<Void>
clear
in interface StreamingCommon<Bytes<Void>>
clear
in class AbstractBytes<Void>
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeByte(byte i8) throws BufferOverflowException, IllegalStateException
writeByte
in interface StreamingDataOutput<Bytes<Void>>
writeByte
in class AbstractBytes<Void>
BufferOverflowException
IllegalStateException
protected void performRelease()
performRelease
in class AbstractBytes<Void>
protected boolean performReleaseInBackground()
performReleaseInBackground
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
public boolean isElastic()
Bytes
Bytes.realCapacity()
.public boolean isBackingFileReadOnly()
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull RandomDataInput bytes, long offset, long length) throws BufferUnderflowException, BufferOverflowException, IllegalStateException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
BufferUnderflowException
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferUnderflowException, BufferOverflowException, IllegalStateException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
BufferUnderflowException
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> append8bit(@NotNull @NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException, IllegalStateException
ByteStringAppender
append8bit
in interface ByteStringAppender<Bytes<Void>>
cs
- to copystart
- index of the first char inclusiveend
- index of the last char exclusive.BufferOverflowException
- If the string as too large to write in the capacity availableBufferUnderflowException
- if the capacity of the underlying buffer was exceededIndexOutOfBoundsException
- if the start or the end are not valid for the CharSequenceIllegalArgumentException
IllegalStateException
@NotNull public @NotNull MappedBytes write8bit(@NotNull @NotNull CharSequence s, int start, int length) throws IllegalStateException, BufferUnderflowException, BufferOverflowException, ArithmeticException, IndexOutOfBoundsException
write8bit
in interface StreamingDataOutput<Bytes<Void>>
IllegalStateException
BufferUnderflowException
BufferOverflowException
ArithmeticException
IndexOutOfBoundsException
@NotNull public @NotNull Bytes<Void> appendUtf8(@NotNull @NotNull CharSequence cs, int start, int length) throws BufferOverflowException, IllegalStateException, BufferUnderflowException, IndexOutOfBoundsException
appendUtf8
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
BufferUnderflowException
IndexOutOfBoundsException
public boolean sharedMemory()
sharedMemory
in interface Bytes<Void>
@NotNull public @NotNull Bytes<Void> writeOrderedInt(long offset, int i) throws BufferOverflowException, IllegalStateException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<Bytes<Void>>
writeOrderedInt
in class AbstractBytes<Void>
offset
- to write toi
- value to writeBufferOverflowException
- if the capacity was exceededIllegalStateException
public byte readVolatileByte(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileByte
in interface RandomDataInput
readVolatileByte
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
- if releasedpublic short readVolatileShort(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileShort
in interface RandomDataInput
readVolatileShort
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
- if releasedpublic int readVolatileInt(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileInt
in interface RandomDataInput
readVolatileInt
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
- if releasedpublic long readVolatileLong(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
readVolatileLong
in interface RandomDataInput
readVolatileLong
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
- if releasedpublic int peekUnsignedByte() throws IllegalStateException
peekUnsignedByte
in interface StreamingDataInput<Bytes<Void>>
peekUnsignedByte
in class AbstractBytes<Void>
IllegalStateException
public int peekUnsignedByte(long offset) throws BufferUnderflowException, IllegalStateException
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
peekUnsignedByte
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIllegalStateException
- if releasedpublic int peekVolatileInt() throws IllegalStateException
peekVolatileInt
in interface RandomDataInput
IllegalStateException
public void release(net.openhft.chronicle.core.io.ReferenceOwner id) throws IllegalStateException
release
in interface net.openhft.chronicle.core.io.ReferenceCounted
release
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
IllegalStateException
public void releaseLast(net.openhft.chronicle.core.io.ReferenceOwner id) throws IllegalStateException
releaseLast
in interface net.openhft.chronicle.core.io.ReferenceCounted
releaseLast
in class net.openhft.chronicle.core.io.AbstractReferenceCounted
IllegalStateException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public boolean isClosed()
isClosed
in interface net.openhft.chronicle.core.io.QueryCloseable
public void warnAndCloseIfNotClosed()
warnAndCloseIfNotClosed
in interface net.openhft.chronicle.core.io.ManagedCloseable
public void throwExceptionIfClosed() throws IllegalStateException
throwExceptionIfClosed
in interface net.openhft.chronicle.core.io.ManagedCloseable
throwExceptionIfClosed
in interface net.openhft.chronicle.core.io.QueryCloseable
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeUtf8(CharSequence str) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeUTF
with the following changes. 1) The length is stop bit encoded
i.e. one byte longer for short strings, but is not limited in length. 2) The string can be null.writeUtf8
in interface StreamingDataOutput<Bytes<Void>>
str
- the string value to be written. Can be null.BufferOverflowException
- if there is not enough space leftIllegalStateException
@NotNull public @NotNull Bytes<Void> writeUtf8(String str) throws BufferOverflowException, IllegalStateException
writeUtf8
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException, IllegalStateException
appendUtf8
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalArgumentException
IllegalStateException
public long readStopBit() throws net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, BufferUnderflowException
readStopBit
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
BufferUnderflowException
public char readStopBitChar() throws net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, BufferUnderflowException
readStopBitChar
in interface StreamingDataInput<Bytes<Void>>
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
BufferUnderflowException
@NotNull public @NotNull Bytes<Void> writeStopBit(long n) throws BufferOverflowException, IllegalStateException
StreamingDataOutput
writeStopBit
in interface StreamingDataOutput<Bytes<Void>>
n
- long to writeBufferOverflowException
IllegalStateException
@NotNull public @NotNull Bytes<Void> writeStopBit(char n) throws BufferOverflowException, IllegalStateException
writeStopBit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalStateException
public boolean isDirectMemory()
isDirectMemory
in interface BytesStore<Bytes<Void>,Void>
isDirectMemory
in class AbstractBytes<Void>
public boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalStateException
compareAndSwapLong
in class AbstractBytes<Void>
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalStateException
public MappedBytes disableThreadSafetyCheck(boolean disableThreadSafetyCheck)
Copyright © 2021. All rights reserved.