public abstract class AbstractBytes<Underlying> extends Object implements Bytes<Underlying>
Modifier and Type | Field and Description |
---|---|
protected BytesStore<Bytes<Underlying>,Underlying> |
bytesStore |
protected long |
readPosition |
protected long |
writeLimit |
protected long |
writePosition |
MAX_CAPACITY
charToString
Modifier and Type | Method and Description |
---|---|
long |
address(long offset)
Obtain the underlying address.
|
default ByteOrder |
byteOrder() |
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.
|
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 |
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(Bytes b2,
long remaining) |
int |
hashCode() |
int |
lastDecimalPlaces() |
void |
lastDecimalPlaces(int lastDecimalPlaces)
Store the last number of decimal places.
|
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 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 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() |
Bytes<Underlying> |
prewrite(byte[] 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) |
default long |
readRemaining() |
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 |
readVolatileInt() |
long |
readVolatileLong() |
long |
realCapacity() |
long |
refCount() |
void |
release() |
void |
reserve() |
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
long |
start() |
String |
toString() |
Underlying |
underlyingObject() |
Bytes<Underlying> |
write(byte[] bytes,
int offset,
int length) |
Bytes<Underlying> |
write(ByteBuffer buffer) |
Bytes<Underlying> |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length) |
Bytes<Underlying> |
write(long offsetInRDO,
RandomDataInput bytes,
long offset,
long length) |
Bytes<Underlying> |
writeByte(byte i8) |
Bytes<Underlying> |
writeByte(long offset,
byte i)
Write an unsigned byte at an offset.
|
Bytes<Underlying> |
writeDouble(double d) |
Bytes<Underlying> |
writeDouble(long offset,
double d)
Write a double at an offset.
|
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.
|
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.
|
protected long |
writeOffsetPositionMoved(long adding) |
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) |
default long |
writeRemaining() |
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> |
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, elasticByteBuffer, elasticByteBuffer, empty, ensureCapacity, expect, expect, from, fromHexString, isClear, isElastic, isEqual, safeLimit, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, wrapForRead, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, bytesForWrite, charAt, contentEquals, copyTo, copyTo, endsWith, equalBytes, inside, length, longCheckSum, nativePointer, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, wrap, zeroOut
addAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, findByte, parseLong, printable, read, readBoolean, readIncompleteLong, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileByte, readVolatileDouble, readVolatileFloat, readVolatileInt, readVolatileLong, readVolatileShort, subBytes, toByteArray, toTemporaryDirectByteBuffer
append, write, write, writeBoolean, writeByte, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, codePoints
inputStream, parseHexLong, parseUTF, parseUtf8, parseWithLength, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readEnum, readStopBit, readStopBitDouble, readUnsignedInt, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength
append, append, append, append, append, append, append, append8bit, append8bit, appendDateMillis, appendDecimal, appendTimeMillis, writer
appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, write, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBoolean, writeEnum, writeStopBit, writeStopBit, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUTFΔ
close, release, releaseAll, tryReserve
closeQuietly, notifyClosing
prepend
@Nullable protected BytesStore<Bytes<Underlying>,Underlying> bytesStore
protected long readPosition
protected long writePosition
protected long writeLimit
@NotNull public Bytes<Underlying> clear()
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
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, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public boolean compareAndSwapLong(long offset, long expected, long value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> readPosition(long position) throws BufferUnderflowException
readPosition
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public Bytes<Underlying> readLimit(long limit) throws BufferUnderflowException
readLimit
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
public Bytes<Underlying> writePosition(long position) throws BufferOverflowException
writePosition
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
public Bytes<Underlying> readSkip(long bytesToSkip) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
StreamingDataInput
readSkip
in interface StreamingDataInput<Bytes<Underlying>>
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> writeSkip(long bytesToSkip) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<Underlying>>
bytesToSkip
- bytes to skip.BufferOverflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> writeLimit(long limit) throws BufferOverflowException
writeLimit
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
public int readUnsignedByte() throws net.openhft.chronicle.core.io.IORuntimeException
readUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
net.openhft.chronicle.core.io.IORuntimeException
public byte readByte() throws net.openhft.chronicle.core.io.IORuntimeException
readByte
in interface StreamingDataInput<Bytes<Underlying>>
net.openhft.chronicle.core.io.IORuntimeException
public int peekUnsignedByte() throws net.openhft.chronicle.core.io.IORuntimeException
peekUnsignedByte
in interface StreamingDataInput<Bytes<Underlying>>
net.openhft.chronicle.core.io.IORuntimeException
public short readShort() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
readShort
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public int readInt() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
readInt
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public long readLong() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
readLong
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public float readFloat() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
readFloat
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public double readDouble() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
readDouble
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public int readVolatileInt() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
readVolatileInt
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public long readVolatileLong() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
readVolatileLong
in interface StreamingDataInput<Bytes<Underlying>>
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
protected long readOffsetPositionMoved(long adding) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
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
@NotNull public Bytes<Underlying> writeByte(long offset, byte i) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeByte
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIORuntimeException
- if the underlying buffer fails to resize.IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeShort(long offset, short i) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeShort
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIORuntimeException
- if the underlying buffer fails to resize.IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeInt(long offset, int i) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeInt
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIORuntimeException
- if the underlying buffer fails to resize.IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeOrderedInt(long offset, int i) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- value to writeBufferOverflowException
- if the capacity was exceededIORuntimeException
- if the underlying buffer fails to resize.IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeLong(long offset, long i) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeLong
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceededIORuntimeException
- if the underlying buffer fails to resize.IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeOrderedLong(long offset, long i) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeOrderedLong
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write toi
- value to writeBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeFloat(long offset, float d) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeFloat
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceededIORuntimeException
- if the underlying buffer fails to resize.IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeDouble(long offset, double d) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataOutput
writeDouble
in interface RandomDataOutput<Bytes<Underlying>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceededIORuntimeException
- if the underlying buffer fails to resize.IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> writeVolatileByte(long offset, byte i8) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileByte
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> writeVolatileShort(long offset, short i16) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileShort
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> writeVolatileInt(long offset, int i32) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileInt
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> writeVolatileLong(long offset, long i64) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
writeVolatileLong
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public void write(long offsetInRDO, ByteBuffer bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> write(long offsetInRDO, RandomDataInput bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
write
in interface RandomDataOutput<Bytes<Underlying>>
BufferOverflowException
BufferUnderflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public byte readByte(long offset) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataInput
readByte
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
public short readShort(long offset) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataInput
readShort
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
public int readInt(long offset) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataInput
readInt
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
public long readLong(long offset) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataInput
readLong
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
public float readFloat(long offset) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataInput
readFloat
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
public double readDouble(long offset) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
RandomDataInput
readDouble
in interface RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeByte(byte i8) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeByte
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> prewrite(byte[] bytes)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<Underlying>>
bytes
- to prepend to.@NotNull public Bytes<Underlying> prewriteByte(byte i8) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteByte
in interface BytesPrepender<Bytes<Underlying>>
i8
- byte to prepend to.BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> prewriteInt(int i)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteInt
in interface BytesPrepender<Bytes<Underlying>>
i
- integer to prepend to.public Bytes<Underlying> prewriteShort(short i)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteShort
in interface BytesPrepender<Bytes<Underlying>>
i
- short to prepend to.public Bytes<Underlying> prewriteLong(long l)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteLong
in interface BytesPrepender<Bytes<Underlying>>
l
- long to prepend to.protected long writeOffsetPositionMoved(long adding) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
protected long prewriteOffsetPositionMoved(long subtracting) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeShort(short i16) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeShort
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeInt(int i) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeLong(long i64) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeLong
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeFloat(float f) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeFloat
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeDouble(double d) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeDouble
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> write(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
write
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> write(@NotNull ByteBuffer buffer) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
write
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeOrderedInt(int i) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeOrderedInt
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> writeOrderedLong(long i) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
writeOrderedLong
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public long address(long offset) throws BufferOverflowException, BufferUnderflowException
offset
- within this buffer. address(start()) is the actual address of the first byte.BufferOverflowException
BufferUnderflowException
public boolean equalsBytes(@NotNull Bytes b2, long remaining) throws net.openhft.chronicle.core.io.IORuntimeException
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public String toString()
toString
in interface CharSequence
toString
in class Object
public void nativeRead(long address, long size) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
StreamingDataInput
nativeRead
in interface StreamingDataInput<Bytes<Underlying>>
address
- of the memory.size
- in bytes.BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public void nativeWrite(long address, long size) throws BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
StreamingDataOutput
nativeWrite
in interface StreamingDataOutput<Bytes<Underlying>>
address
- to write to.size
- in bytes.BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public void nativeRead(long position, long address, long size)
RandomDataInput
nativeRead
in interface RandomDataInput
position
- within the ByteStore to copy.address
- in native memorysize
- in bytespublic void nativeWrite(long address, long position, long size)
RandomDataOutput
nativeWrite
in interface RandomDataOutput<Bytes<Underlying>>
address
- in native memory to copy fromposition
- in BytesStore to copy tosize
- in bytes@Nullable 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 Reader reader()
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.@NotNull public String parseUtf8(@NotNull StopCharTester stopCharTester)
stopCharTester
- to check if the end has been reached.@Deprecated public String parseUTF(@NotNull StopCharTester stopCharTester)
public void parseUtf8(@NotNull Appendable buffer, @NotNull StopCharTester stopCharTester)
buffer
- to populatestopCharTester
- to check if the end has been reached.@Deprecated public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharTester stopCharTester)
public void parseUtf8(@NotNull Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
@Deprecated public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public void parse8bit(Appendable buffer, @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public void parse8bit(Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
net.openhft.chronicle.core.io.IORuntimeException
public long parseLong() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public double parseDouble() throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public long parseLongDecimal() throws BufferUnderflowException
BufferUnderflowException
public boolean skipTo(@NotNull StopCharTester tester) throws net.openhft.chronicle.core.io.IORuntimeException
tester
- to stop atnet.openhft.chronicle.core.io.IORuntimeException
public long readRemaining()
public long writeRemaining()
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
Copyright © 2015. All rights reserved.