public class MappedBytes extends AbstractBytes<Void> implements net.openhft.chronicle.core.io.Closeable
NOTE These Bytes are single Threaded as are all Bytes.
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
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)
Obtain the underlying addressForRead.
|
long |
addressForRead(long offset,
int buffer) |
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) |
default ByteOrder |
byteOrder() |
@NotNull MappedBytesStore |
bytesStore() |
protected void |
bytesStore(BytesStore bytesStore) |
long |
capacity() |
@NotNull Bytes<Void> |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
void |
close() |
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.
|
boolean |
compareAndSwapLong(long offset,
long expected,
long value)
Perform a 64-bit CAS at a given offset.
|
BytesStore<Bytes<Void>,Void> |
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 |
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() |
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.
|
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) |
default @NotNull Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
Bytes<Void> |
readLimitToCapacity() |
static @NotNull MappedBytes |
readOnly(@NotNull File file) |
@NotNull Bytes<Void> |
readPosition(long position) |
@NotNull Bytes<Void> |
readPositionRemaining(long position,
long remaining) |
default long |
readRemaining() |
@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.
|
void |
release(net.openhft.chronicle.core.io.ReferenceOwner id) |
void |
releaseLast(net.openhft.chronicle.core.io.ReferenceOwner id) |
void |
setNewChunkListener(NewChunkListener listener) |
boolean |
sharedMemory() |
default boolean |
skipTo(@NotNull StopCharTester tester)
Skip text until a terminating character is reached.
|
long |
start() |
@NotNull String |
toString() |
@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(@Nullable BytesStore bs) |
@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) |
default long |
writeRemaining() |
@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, isPresent, isPresent, lastDecimalPlaces, lastDecimalPlaces, lenient, lenient, move, nativeRead, nativeRead, nativeWrite, nativeWrite, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteOffsetPositionMoved, prewriteShort, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLimit, readLimit, readLong, readLong, readOffsetPositionMoved, readPosition, readShort, readShort, readUnsignedByte, readUnsignedByte, readVolatileInt, readVolatileLong, realWriteRemaining, safeCopySize, testAndSetInt, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, underlyingObject, write, writeByte, writeDouble, writeDouble, writeDoubleAndInt, writeFloat, writeFloat, writeInt, writeInt, writeIntAdv, writeLimit, writeLimit, writeLong, writeLong, writeLongAdv, writeOffsetPositionMoved, writeOffsetPositionMoved, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writeShort, writeShort, writeSkip, 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
isClosing, throwExceptionIfClosed
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, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, 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, 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, readBoolean, readChar, readEnum, readHistogram, readIncompleteLong, readInt24, readPositionUnlimited, 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, copyFrom, outputStream, rawWriteByte, rawWriteInt, rawWriteLong, unsafeWriteObject, unsafeWriteObject, write, write, write, write, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeChar, writeEnum, writeHistogram, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUTFΔ, writeWithLength
refCount, releaseLast, reserve, reservedBy, reserveTransfer, tryReserve
referenceId, referenceName, temporary
prepend
comment, indent, retainsComments
protected MappedBytes(@NotNull @NotNull MappedFile mappedFile) throws IllegalStateException
IllegalStateException
protected MappedBytes(@NotNull @NotNull MappedFile mappedFile, String name) throws IllegalStateException
IllegalStateException
@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)
@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)
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
@NotNull public @NotNull MappedBytes write(long offsetInRDO, byte[] bytes, int offset, int length)
write
in interface RandomDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
@NotNull public @NotNull MappedBytes write(long writeOffset, RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, BufferUnderflowException
write
in interface RandomDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
BufferOverflowException
BufferUnderflowException
@NotNull public @NotNull MappedBytes write(@NotNull @NotNull RandomDataInput bytes) throws BufferOverflowException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
write
in class AbstractBytes<Void>
BufferOverflowException
@NotNull public @NotNull MappedBytes write(long offsetInRDO, @NotNull @NotNull RandomDataInput bytes) throws BufferOverflowException
BufferOverflowException
public void setNewChunkListener(NewChunkListener listener)
@NotNull public @NotNull MappedFile mappedFile()
public BytesStore<Bytes<Void>,Void> copy()
public long capacity()
capacity
in interface BytesStore<Bytes<Void>,Void>
capacity
in class AbstractBytes<Void>
public Bytes<Void> readLimitToCapacity() throws BufferUnderflowException
BufferUnderflowException
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
BufferUnderflowException
@NotNull public @NotNull Bytes<Void> readPosition(long position) throws BufferUnderflowException
readPosition
in class AbstractBytes<Void>
BufferUnderflowException
public long addressForRead(long offset) throws BufferUnderflowException
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()public long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException
public long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException
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()protected void readCheckOffset(long offset, long adding, boolean given) throws BufferUnderflowException
BufferUnderflowException
@Nullable public @Nullable String read8bit() throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
protected void writeCheckOffset(long offset, long adding) throws BufferOverflowException
BufferOverflowException
public void ensureCapacity(long size) throws IllegalArgumentException
Bytes
BufferOverflowException
ensureCapacity
in interface Bytes<Void>
size
- the capacity that you requiredIllegalArgumentException
- if the buffer is not elastic and there is not enough space@NotNull public @NotNull Bytes<Void> readSkip(long bytesToSkip) throws BufferUnderflowException
StreamingDataInput
readSkip
in class AbstractBytes<Void>
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the Bytes@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()
StreamingCommon
clear
in interface Bytes<Void>
clear
in interface StreamingCommon<Bytes<Void>>
clear
in class AbstractBytes<Void>
@NotNull public @NotNull Bytes<Void> writeByte(byte i8) throws BufferOverflowException
writeByte
in interface StreamingDataOutput<Bytes<Void>>
writeByte
in class AbstractBytes<Void>
BufferOverflowException
protected void performRelease() throws IllegalStateException
performRelease
in class AbstractBytes<Void>
IllegalStateException
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
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
BufferUnderflowException
BufferOverflowException
@NotNull public @NotNull Bytes<Void> write(@NotNull @NotNull BytesStore bytes, long offset, long length) throws BufferUnderflowException, BufferOverflowException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Void>>
BufferUnderflowException
BufferOverflowException
@NotNull public @NotNull Bytes<Void> append8bit(@NotNull @NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException
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
@NotNull public @NotNull MappedBytes write8bit(@NotNull @NotNull CharSequence s, int start, int length)
write8bit
in interface StreamingDataOutput<Bytes<Void>>
@NotNull public @NotNull Bytes<Void> appendUtf8(@NotNull @NotNull CharSequence cs, int start, int length) throws BufferOverflowException, IllegalArgumentException
appendUtf8
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalArgumentException
public boolean sharedMemory()
sharedMemory
in interface Bytes<Void>
@NotNull public @NotNull Bytes<Void> writeOrderedInt(long offset, int i) throws BufferOverflowException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<Bytes<Void>>
writeOrderedInt
in class AbstractBytes<Void>
offset
- to write toi
- value to writeBufferOverflowException
- if the capacity was exceededpublic byte readVolatileByte(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileByte
in interface RandomDataInput
readVolatileByte
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic short readVolatileShort(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileShort
in interface RandomDataInput
readVolatileShort
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int readVolatileInt(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileInt
in interface RandomDataInput
readVolatileInt
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic long readVolatileLong(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileLong
in interface RandomDataInput
readVolatileLong
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int peekUnsignedByte()
peekUnsignedByte
in class AbstractBytes<Void>
public int peekUnsignedByte(long offset) throws BufferUnderflowException
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
peekUnsignedByte
in class AbstractBytes<Void>
offset
- to readBufferUnderflowException
public int peekVolatileInt()
peekVolatileInt
in interface RandomDataInput
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
@NotNull public @NotNull Bytes<Void> writeUtf8(CharSequence str) throws BufferOverflowException
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 left@NotNull public @NotNull Bytes<Void> writeUtf8(String str) throws BufferOverflowException
writeUtf8
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
@NotNull public @NotNull Bytes<Void> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException
appendUtf8
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
IllegalArgumentException
public long readStopBit() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
public char readStopBitChar() throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public @NotNull Bytes<Void> writeStopBit(long n) throws BufferOverflowException
StreamingDataOutput
writeStopBit
in interface StreamingDataOutput<Bytes<Void>>
n
- long to writeBufferOverflowException
@NotNull public @NotNull Bytes<Void> writeStopBit(char n) throws BufferOverflowException
writeStopBit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
public boolean isDirectMemory()
isDirectMemory
in interface BytesStore<Bytes<Void>,Void>
isDirectMemory
in class AbstractBytes<Void>
@NotNull public @NotNull MappedBytes write8bit(@Nullable @Nullable BytesStore bs) throws BufferOverflowException
write8bit
in interface StreamingDataOutput<Bytes<Void>>
BufferOverflowException
public boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException
compareAndSwapLong
in class AbstractBytes<Void>
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
@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 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.