public abstract class AbstractBytes<Underlying> extends Object implements Bytes<Underlying>
Modifier and Type | Field and Description |
---|---|
protected BytesStore<Bytes<Underlying>,Underlying> |
bytesStore |
protected boolean |
isPresent |
protected long |
readPosition |
protected long |
writeLimit |
protected long |
writePosition |
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_BYTE_BUFFER_CAPACITY, MAX_CAPACITY
charToString
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
Obtain the underlying addressForRead.
|
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
int |
byteCheckSum()
Return the bytes sum of the readable bytes.
|
int |
byteCheckSum(int start,
int end) |
int |
byteCheckSum(long start,
long end) |
BytesStore |
bytesStore() |
long |
capacity() |
Bytes<Underlying> |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
Bytes<Underlying> |
clearAndPad(long length)
Clear a buffer, with a given padding to allow for prepending later.
|
Bytes<Underlying> |
compact()
Compact these Bytes by moving the readPosition to the start.
|
boolean |
compareAndSwapInt(long offset,
int expected,
int value)
Perform a 32-bit CAS at a given offset.
|
boolean |
compareAndSwapLong(long offset,
long expected,
long value)
Perform a 64-bit CAS at a given offset.
|
boolean |
equals(Object obj) |
boolean |
equalsBytes(BytesStore b2,
long remaining) |
int |
hashCode() |
boolean |
isDirectMemory() |
boolean |
isPresent() |
void |
isPresent(boolean isPresent)
Clear and set the flag for present.
|
int |
lastDecimalPlaces() |
void |
lastDecimalPlaces(int lastDecimalPlaces)
Store the last number of decimal places.
|
boolean |
lenient() |
void |
lenient(boolean lenient)
When there is no more data to read, return zero, false and empty string.
|
void |
move(long from,
long to,
long length) |
void |
nativeRead(long address,
long size)
This is an expert level method for copying raw native memory in bulk.
|
void |
nativeRead(long position,
long address,
long size)
expert level method for copying data to native memory.
|
void |
nativeWrite(long address,
long size)
This is an expert level method for writing out data to native memory.
|
void |
nativeWrite(long address,
long position,
long size)
expert level method to copy data from native memory into the BytesStore
|
default void |
parse8bit(Appendable buffer,
StopCharsTester stopCharsTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Appendable buffer,
StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Bytes buffer,
StopCharsTester stopCharsTester) |
default String |
parse8bit(StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(StringBuilder buffer,
StopCharsTester stopCharsTester) |
default BigDecimal |
parseBigDecimal() |
default Boolean |
parseBoolean() |
default Boolean |
parseBoolean(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(Appendable buffer,
StopCharsTester stopCharsTester)
Deprecated.
|
default void |
parseUTF(Appendable buffer,
StopCharTester stopCharTester)
Deprecated.
|
default String |
parseUTF(StopCharTester stopCharTester)
Deprecated.
|
default void |
parseUtf8(Appendable buffer,
StopCharsTester stopCharsTester)
parse text with UTF-8 decoding as one or two character terminated.
|
default void |
parseUtf8(Appendable buffer,
StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default String |
parseUtf8(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
|
Bytes<Underlying> |
prewrite(byte[] bytes)
Write backward in binary a byte
|
Bytes<Underlying> |
prewrite(BytesStore bytes)
Write backward in binary a byte
|
Bytes<Underlying> |
prewriteByte(byte i8)
Write backward in binary a byte
|
Bytes<Underlying> |
prewriteInt(int i)
Write backward in binary a 4 byte int
|
Bytes<Underlying> |
prewriteLong(long l)
Write backward in binary an 8 byte long
|
protected long |
prewriteOffsetPositionMoved(long subtracting) |
Bytes<Underlying> |
prewriteShort(short i)
Write backward in binary a 2 byte int
|
byte |
readByte() |
byte |
readByte(long offset)
Read byte at an offset
|
double |
readDouble() |
double |
readDouble(long offset)
Read a double at an offset
|
default Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
float |
readFloat() |
float |
readFloat(long offset)
Read a float at an offset
|
int |
readInt() |
int |
readInt(long offset)
Read an int at an offset
|
long |
readLimit() |
Bytes<Underlying> |
readLimit(long limit) |
long |
readLong() |
long |
readLong(long offset)
Read a long at an offset
|
protected long |
readOffsetPositionMoved(long adding) |
long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
Bytes<Underlying> |
readPosition(long position) |
short |
readShort() |
short |
readShort(long offset)
Read a short at an offset
|
Bytes<Underlying> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
int |
readUnsignedByte() |
int |
readUnsignedByte(long offset)
Read an unsigned byte at an offset
|
byte |
readVolatileByte(long offset)
Read a 8-bit byte from memory with a load barrier.
|
int |
readVolatileInt() |
int |
readVolatileInt(long offset)
Read a 32-bit int from memory with a load barrier.
|
long |
readVolatileLong() |
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() |
long |
refCount() |
void |
release() |
void |
reserve() |
protected int |
safeCopySize() |
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
long |
start() |
String |
toString() |
boolean |
tryReserve() |
void |
uncheckedReadSkipBackOne()
Read skip -1 when you are sure this is safe.
|
void |
uncheckedReadSkipOne()
Read skip 1 when you are sure this is safe.
|
int |
uncheckedReadUnsignedByte() |
Underlying |
underlyingObject() |
Bytes<Underlying> |
write(byte[] bytes,
int offset,
int length)
Write all data or fail.
|
Bytes<Underlying> |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length)
Deprecated.
|
Bytes<Underlying> |
write(long writeOffset,
RandomDataInput bytes,
long readOffset,
long length) |
Bytes<Underlying> |
writeByte(byte i8) |
Bytes<Underlying> |
writeByte(long offset,
byte i)
Write an unsigned byte at an offset.
|
protected boolean |
writeCheckOffset0(long offset,
long adding) |
Bytes<Underlying> |
writeDouble(double d) |
Bytes<Underlying> |
writeDouble(long offset,
double d)
Write a double at an offset.
|
Bytes<Underlying> |
writeDoubleAndInt(double d,
int i) |
Bytes<Underlying> |
writeFloat(float f) |
Bytes<Underlying> |
writeFloat(long offset,
float d)
Write a float at an offset.
|
Bytes<Underlying> |
writeInt(int i) |
Bytes<Underlying> |
writeInt(long offset,
int i)
Write an int at an offset.
|
Bytes<Underlying> |
writeIntAdv(int i,
int advance) |
long |
writeLimit() |
Bytes<Underlying> |
writeLimit(long limit) |
Bytes<Underlying> |
writeLong(long i64) |
Bytes<Underlying> |
writeLong(long offset,
long i)
Write a long at an offset.
|
Bytes<Underlying> |
writeLongAdv(long i64,
int advance) |
protected long |
writeOffsetPositionMoved(long adding) |
protected long |
writeOffsetPositionMoved(long adding,
long advance) |
Bytes<Underlying> |
writeOrderedInt(int i) |
Bytes<Underlying> |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
Bytes<Underlying> |
writeOrderedLong(long i) |
Bytes<Underlying> |
writeOrderedLong(long offset,
long i)
Perform a non stalling write with a store barrier.
|
long |
writePosition()
The read position must be readPosition() <= writePosition() && writePosition() <= writeLimit()
|
Bytes<Underlying> |
writePosition(long position) |
Bytes<Underlying> |
writeShort(long offset,
short i)
Write a short at an offset.
|
Bytes<Underlying> |
writeShort(short i16) |
Bytes<Underlying> |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
Bytes<Underlying> |
writeSome(ByteBuffer buffer) |
Bytes<Underlying> |
writeVolatileByte(long offset,
byte i8) |
Bytes<Underlying> |
writeVolatileInt(long offset,
int i32) |
Bytes<Underlying> |
writeVolatileLong(long offset,
long i64) |
Bytes<Underlying> |
writeVolatileShort(long offset,
short i16) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, bytesForRead, copy, copyTo, copyTo, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, ensureCapacity, from, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, isElastic, isEqual, readBigDecimal, readBigInteger, readMarshallableLength16, readWithLength, readWrite, safeLimit, sharedMemory, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, unwrite, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite, 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, writeMaxLong, zeroOut
addAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, peekVolatileInt, printable, read, readBoolean, readIncompleteLong, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBuffer
append, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, codePoints
bytesMethodReader, bytesMethodReaderBuilder, readObject
inputStream, parseHexLong, parseUTF, parseUtf8, read, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readEnum, readHistogram, readInt24, readPositionRemaining, readPositionUnlimited, readStopBit, readStopBitChar, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength, readWithLength, readWithLength0
bytesMethodWriter, bytesMethodWriterBuilder, writeObject
append, append, append, append, append, append, append, append, append, append, append8bit, append8bit, append8bit, appendBase, appendBase16, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writer
appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, write, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeEnum, writeHistogram, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt24, writeUnsignedShort, writeUtf8, writeUtf8, writeUTFΔ, writeWithLength
prepend
comment, indent, retainsComments
@NotNull protected BytesStore<Bytes<Underlying>,Underlying> bytesStore
protected long readPosition
protected long writePosition
protected long writeLimit
protected boolean isPresent
public boolean isDirectMemory()
isDirectMemory
in interface BytesStore<Bytes<Underlying>,Underlying>
public void move(long from, long to, long length) throws BufferUnderflowException
move
in interface BytesStore<Bytes<Underlying>,Underlying>
BufferUnderflowException
@NotNull public Bytes<Underlying> compact()
Bytes
compact
in interface Bytes<Underlying>
public void isPresent(boolean isPresent)
BytesStore
isPresent
in interface BytesStore<Bytes<Underlying>,Underlying>
isPresent
- if there is data, or false if not.public boolean isPresent()
isPresent
in interface BytesStore<Bytes<Underlying>,Underlying>
@NotNull public Bytes<Underlying> clear()
StreamingCommon
clear
in interface Bytes<Underlying>
clear
in interface StreamingCommon<Bytes<Underlying>>
@NotNull public Bytes<Underlying> clearAndPad(long length) throws BufferOverflowException
BytesPrepender
clearAndPad
in interface BytesPrepender<Bytes<Underlying>>
length
- to padBufferOverflowException
- if the length > capacity() - start()public long readLimit()
public long writeLimit()
public long realCapacity()
realCapacity
in interface Bytes<Underlying>
realCapacity
in interface BytesStore<Bytes<Underlying>,Underlying>
realCapacity
in interface RandomDataInput
realCapacity
in interface StreamingDataOutput<Bytes<Underlying>>
public long capacity()
capacity
in interface BytesStore<Bytes<Underlying>,Underlying>
@Nullable public Underlying underlyingObject()
underlyingObject
in interface BytesStore<Bytes<Underlying>,Underlying>
public long start()
public long readPosition()
public long writePosition()
public boolean compareAndSwapInt(long offset, int expected, int value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
public boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
@NotNull public Bytes<Underlying> readPosition(long position) throws BufferUnderflowException
readPosition
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
@NotNull public Bytes<Underlying> readLimit(long limit) throws BufferUnderflowException
readLimit
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
@NotNull public Bytes<Underlying> writePosition(long position) throws BufferOverflowException
writePosition
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> readSkip(long bytesToSkip) throws BufferUnderflowException
StreamingDataInput
readSkip
in interface StreamingDataInput<Bytes<Underlying>>
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the Bytespublic void uncheckedReadSkipOne()
StreamingDataInput
uncheckedReadSkipOne
in interface StreamingDataInput<Bytes<Underlying>>
public void uncheckedReadSkipBackOne()
StreamingDataInput
uncheckedReadSkipBackOne
in interface StreamingDataInput<Bytes<Underlying>>
@NotNull public Bytes<Underlying> writeSkip(long bytesToSkip) throws BufferOverflowException
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<Underlying>>
bytesToSkip
- bytes to skip.BufferOverflowException
- if the offset is outside the limits of the Bytes@NotNull public Bytes<Underlying> writeLimit(long limit) throws BufferOverflowException
writeLimit
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
public int readUnsignedByte()
readUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
public int readUnsignedByte(long offset) throws BufferUnderflowException
RandomDataInput
readUnsignedByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int uncheckedReadUnsignedByte()
uncheckedReadUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
public byte readByte()
readByte
in interface StreamingDataInput<Bytes<Underlying>>
public int peekUnsignedByte()
peekUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
public short readShort() throws BufferUnderflowException
readShort
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public int readInt() throws BufferUnderflowException
readInt
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public byte readVolatileByte(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic short readVolatileShort(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileShort
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int readVolatileInt(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileInt
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic long readVolatileLong(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileLong
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic long readLong() throws BufferUnderflowException
readLong
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public float readFloat() throws BufferUnderflowException
readFloat
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public double readDouble() throws BufferUnderflowException
readDouble
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public int readVolatileInt() throws BufferUnderflowException
readVolatileInt
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public long readVolatileLong() throws BufferUnderflowException
readVolatileLong
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
protected long readOffsetPositionMoved(long adding) throws BufferUnderflowException
BufferUnderflowException
public void reserve() throws IllegalStateException
reserve
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
public void release() throws IllegalStateException
release
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
public long refCount()
refCount
in interface net.openhft.chronicle.core.ReferenceCounted
public boolean tryReserve()
tryReserve
in interface net.openhft.chronicle.core.ReferenceCounted
@NotNull public Bytes<Underlying> writeByte(long offset, byte i) throws BufferOverflowException
RandomDataOutput
writeByte
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<Underlying> writeShort(long offset, short i) throws BufferOverflowException
RandomDataOutput
writeShort
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<Underlying> writeInt(long offset, int i) throws BufferOverflowException
RandomDataOutput
writeInt
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<Underlying> writeOrderedInt(long offset, int i) throws BufferOverflowException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- value to writeBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<Underlying> writeLong(long offset, long i) throws BufferOverflowException
RandomDataOutput
writeLong
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<Underlying> writeOrderedLong(long offset, long i) throws BufferOverflowException
RandomDataOutput
writeOrderedLong
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- value to writeBufferOverflowException
@NotNull public Bytes<Underlying> writeFloat(long offset, float d) throws BufferOverflowException
RandomDataOutput
writeFloat
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<Underlying> writeDouble(long offset, double d) throws BufferOverflowException
RandomDataOutput
writeDouble
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<Underlying> writeVolatileByte(long offset, byte i8) throws BufferOverflowException
writeVolatileByte
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeVolatileShort(long offset, short i16) throws BufferOverflowException
writeVolatileShort
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeVolatileInt(long offset, int i32) throws BufferOverflowException
writeVolatileInt
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeVolatileLong(long offset, long i64) throws BufferOverflowException
writeVolatileLong
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
@Deprecated public void write(long offsetInRDO, ByteBuffer bytes, int offset, int length) throws BufferOverflowException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> write(long writeOffset, RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, BufferUnderflowException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
BufferUnderflowException
protected boolean writeCheckOffset0(long offset, long adding) throws BufferOverflowException
BufferOverflowException
public byte readByte(long offset) throws BufferUnderflowException
RandomDataInput
readByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int peekUnsignedByte(long offset) throws BufferUnderflowException
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
public short readShort(long offset) throws BufferUnderflowException
RandomDataInput
readShort
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic int readInt(long offset) throws BufferUnderflowException
RandomDataInput
readInt
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic long readLong(long offset) throws BufferUnderflowException
RandomDataInput
readLong
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic float readFloat(long offset) throws BufferUnderflowException
RandomDataInput
readFloat
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic double readDouble(long offset) throws BufferUnderflowException
RandomDataInput
readDouble
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytes@NotNull public Bytes<Underlying> writeByte(byte i8) throws BufferOverflowException
writeByte
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> prewrite(@NotNull byte[] bytes) throws BufferOverflowException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<Underlying>>
bytes
- to prepend to.BufferOverflowException
@NotNull public Bytes<Underlying> prewrite(@NotNull BytesStore bytes) throws BufferOverflowException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<Underlying>>
bytes
- to prepend to.BufferOverflowException
@NotNull public Bytes<Underlying> prewriteByte(byte i8) throws BufferOverflowException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteByte
in interface BytesPrepender<Bytes<Underlying>>
i8
- byte to prepend to.BufferOverflowException
@NotNull public Bytes<Underlying> prewriteInt(int i) throws BufferOverflowException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteInt
in interface BytesPrepender<Bytes<Underlying>>
i
- integer to prepend to.BufferOverflowException
@NotNull public Bytes<Underlying> prewriteShort(short i) throws BufferOverflowException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteShort
in interface BytesPrepender<Bytes<Underlying>>
i
- short to prepend to.BufferOverflowException
@NotNull public Bytes<Underlying> prewriteLong(long l) throws BufferOverflowException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteLong
in interface BytesPrepender<Bytes<Underlying>>
l
- long to prepend to.BufferOverflowException
protected final long writeOffsetPositionMoved(long adding) throws BufferOverflowException
BufferOverflowException
protected long writeOffsetPositionMoved(long adding, long advance) throws BufferOverflowException
BufferOverflowException
protected long prewriteOffsetPositionMoved(long subtracting) throws BufferOverflowException
BufferOverflowException
@NotNull public Bytes<Underlying> writeShort(short i16) throws BufferOverflowException
writeShort
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeInt(int i) throws BufferOverflowException
writeInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeIntAdv(int i, int advance) throws BufferOverflowException
writeIntAdv
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeLong(long i64) throws BufferOverflowException
writeLong
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeLongAdv(long i64, int advance) throws BufferOverflowException
writeLongAdv
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeFloat(float f) throws BufferOverflowException
writeFloat
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeDouble(double d) throws BufferOverflowException
writeDouble
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeDoubleAndInt(double d, int i) throws BufferOverflowException
writeDoubleAndInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> write(@NotNull byte[] bytes, int offset, int length) throws BufferOverflowException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
protected int safeCopySize()
@NotNull public Bytes<Underlying> writeSome(@NotNull ByteBuffer buffer) throws BufferOverflowException
writeSome
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeOrderedInt(int i) throws BufferOverflowException
writeOrderedInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> writeOrderedLong(long i) throws BufferOverflowException
writeOrderedLong
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
public long addressForRead(long offset) throws BufferUnderflowException
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 addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException
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()public boolean equalsBytes(@NotNull BytesStore b2, long remaining)
@NotNull public String toString()
toString
in interface CharSequence
toString
in class Object
public void nativeRead(long address, long size) throws BufferUnderflowException
StreamingDataInput
nativeRead
in interface StreamingDataInput<Bytes<Underlying>>
address
- of the memory.size
- in bytes.BufferUnderflowException
public void nativeWrite(long address, long size) throws BufferOverflowException
StreamingDataOutput
nativeWrite
in interface StreamingDataOutput<Bytes<Underlying>>
address
- to write to.size
- in bytes.BufferOverflowException
public void nativeRead(long position, long address, long size) throws BufferUnderflowException
RandomDataInput
nativeRead
in interface RandomDataInput
position
- within the ByteStore to copy.address
- in native memorysize
- in bytesBufferUnderflowException
- if the offset is outside the limits of the Bytespublic void nativeWrite(long address, long position, long size) throws BufferOverflowException
RandomDataOutput
nativeWrite
in interface RandomDataOutput<Bytes<Underlying>>
address
- in native memory to copy fromposition
- in BytesStore to copy tosize
- in bytesBufferOverflowException
@NotNull public BytesStore bytesStore()
bytesStore
in interface Bytes<Underlying>
bytesStore
in interface BytesStore<Bytes<Underlying>,Underlying>
public int lastDecimalPlaces()
public void lastDecimalPlaces(int lastDecimalPlaces)
lastDecimalPlaces
- set the number of decimal places if positive, otherwise 0.public void lenient(boolean lenient)
StreamingDataInput
lenient
in interface StreamingDataInput<Bytes<Underlying>>
lenient
- if true, return nothing rather than error.public boolean lenient()
lenient
in interface StreamingDataInput<Bytes<Underlying>>
public int byteCheckSum() throws net.openhft.chronicle.core.io.IORuntimeException
BytesStore
byteCheckSum
in interface BytesStore<Bytes<Underlying>,Underlying>
net.openhft.chronicle.core.io.IORuntimeException
public int byteCheckSum(long start, long end)
byteCheckSum
in interface BytesStore<Bytes<Underlying>,Underlying>
public int byteCheckSum(int start, int end)
@NotNull public Reader reader()
@Nullable public Boolean parseBoolean(@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 Boolean parseBoolean()
@NotNull public String parseUtf8(@NotNull StopCharTester stopCharTester)
stopCharTester
- to check if the end has been reached.@NotNull @Deprecated public String parseUTF(@NotNull StopCharTester stopCharTester)
public void parseUtf8(@NotNull Appendable buffer, @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
@Deprecated public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
BufferUnderflowException
public void parseUtf8(@NotNull Appendable buffer, @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 Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public void parse8bit(Appendable buffer, @NotNull StopCharTester stopCharTester) throws BufferUnderflowException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
public String parse8bit(@NotNull StopCharTester stopCharTester) throws BufferUnderflowException
stopCharTester
- to check if the end has been reached.BufferUnderflowException
public void parse8bit(Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
public void parse8bit(Bytes buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException
BufferUnderflowException
public void parse8bit(StringBuilder buffer, @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 StopCharTester tester)
tester
- to stop at@NotNull public BigDecimal parseBigDecimal()
Copyright © 2018. All rights reserved.