public class HexDumpBytes extends Object implements Bytes<ByteBuffer>
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_BYTE_BUFFER_CAPACITY, MAX_CAPACITY
charToString
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Constructor and Description |
---|
HexDumpBytes() |
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
Obtain the underlying addressForRead.
|
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
BytesStore |
bytesStore() |
long |
capacity() |
Bytes |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
Bytes<ByteBuffer> |
clearAndPad(long length)
Clear a buffer, with a given padding to allow for prepending later.
|
Bytes<ByteBuffer> |
comment(CharSequence comment)
Add comment as approriate for the toHexString format
|
Bytes |
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.
|
BytesStore |
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 |
static HexDumpBytes |
fromText(CharSequence text) |
static HexDumpBytes |
fromText(Reader reader) |
BytesOut |
indent(int n)
Adjust the indent for nested data
|
boolean |
isDirectMemory() |
boolean |
isElastic() |
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
|
int |
numberWrap() |
HexDumpBytes |
numberWrap(int numberWrap) |
HexDumpBytes |
offsetFormat(OffsetFormat offsetFormat) |
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<ByteBuffer> |
prewrite(byte[] bytes)
Write backward in binary a byte
|
Bytes<ByteBuffer> |
prewrite(BytesStore bytes)
Write backward in binary a byte
|
Bytes<ByteBuffer> |
prewriteByte(byte b)
Write backward in binary a byte
|
Bytes<ByteBuffer> |
prewriteInt(int i)
Write backward in binary a 4 byte int
|
Bytes<ByteBuffer> |
prewriteLong(long l)
Write backward in binary an 8 byte long
|
Bytes<ByteBuffer> |
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<ByteBuffer> |
readLimit(long limit) |
long |
readLong() |
long |
readLong(long offset)
Read a long at an offset
|
long |
readPosition()
The read position must be start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
|
Bytes<ByteBuffer> |
readPosition(long position) |
long |
readRemaining() |
short |
readShort() |
short |
readShort(long offset)
Read a short at an offset
|
Bytes<ByteBuffer> |
readSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
int |
readUnsignedByte() |
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 |
refCount() |
void |
release() |
void |
reserve() |
boolean |
retainsComments()
Do these Bytes support saving comments
|
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
String |
toHexString()
display the hex data of
Bytes from the position() to the limit() |
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() |
ByteBuffer |
underlyingObject() |
Bytes<ByteBuffer> |
write(byte[] bytes,
int offset,
int length)
Write all data or fail.
|
Bytes<ByteBuffer> |
write(long offsetInRDO,
byte[] bytes,
int offset,
int length) |
void |
write(long offsetInRDO,
ByteBuffer bytes,
int offset,
int length) |
Bytes<ByteBuffer> |
write(long writeOffset,
RandomDataInput bytes,
long readOffset,
long length) |
Bytes<ByteBuffer> |
writeByte(byte i8) |
Bytes<ByteBuffer> |
writeByte(long offset,
byte i8)
Write an unsigned byte at an offset.
|
Bytes<ByteBuffer> |
writeDouble(double d) |
Bytes<ByteBuffer> |
writeDouble(long offset,
double d)
Write a double at an offset.
|
Bytes<ByteBuffer> |
writeDoubleAndInt(double d,
int i) |
Bytes<ByteBuffer> |
writeFloat(float f) |
Bytes<ByteBuffer> |
writeFloat(long offset,
float d)
Write a float at an offset.
|
Bytes<ByteBuffer> |
writeInt(int i) |
Bytes<ByteBuffer> |
writeInt(long offset,
int i)
Write an int at an offset.
|
Bytes<ByteBuffer> |
writeInt24(long offset,
int i) |
Bytes<ByteBuffer> |
writeIntAdv(int i,
int advance) |
long |
writeLimit() |
Bytes<ByteBuffer> |
writeLimit(long limit) |
Bytes<ByteBuffer> |
writeLong(long i64) |
Bytes<ByteBuffer> |
writeLong(long offset,
long i)
Write a long at an offset.
|
Bytes<ByteBuffer> |
writeLongAdv(long i64,
int advance) |
Bytes<ByteBuffer> |
writeOrderedInt(int i) |
Bytes<ByteBuffer> |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
Bytes<ByteBuffer> |
writeOrderedLong(long i) |
Bytes<ByteBuffer> |
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<ByteBuffer> |
writePosition(long position) |
long |
writeRemaining() |
Bytes<ByteBuffer> |
writeShort(long offset,
short i)
Write a short at an offset.
|
Bytes<ByteBuffer> |
writeShort(short i16) |
Bytes<ByteBuffer> |
writeSkip(long bytesToSkip)
Skip a number of bytes by moving the readPosition.
|
Bytes<ByteBuffer> |
writeSome(ByteBuffer buffer) |
Bytes<ByteBuffer> |
writeVolatileByte(long offset,
byte i8) |
Bytes<ByteBuffer> |
writeVolatileInt(long offset,
int i32) |
Bytes<ByteBuffer> |
writeVolatileLong(long offset,
long i64) |
Bytes<ByteBuffer> |
writeVolatileShort(long offset,
short i16) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, bytesForRead, copyTo, copyTo, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, from, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, isEqual, readBigDecimal, readBigInteger, readMarshallableLength16, readWithLength, readWrite, realCapacity, safeLimit, sharedMemory, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, unwrite, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite, writeMarshallableLength16
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, byteCheckSum, bytesForWrite, charAt, cipher, cipher, contentEquals, empty, endsWith, equalBytes, inside, inside, isEmpty, isPresent, isPresent, 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, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBuffer
append, append, write, write, writeBoolean, writeByte, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, codePoints, toString
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
public static HexDumpBytes fromText(Reader reader)
public static HexDumpBytes fromText(CharSequence text)
public HexDumpBytes offsetFormat(OffsetFormat offsetFormat)
public int numberWrap()
public HexDumpBytes numberWrap(int numberWrap)
public long readRemaining()
public long writeRemaining()
public long readLimit()
public long writeLimit()
@NotNull public String toHexString()
Bytes
Bytes
from the position() to the limit()toHexString
in interface Bytes<ByteBuffer>
public boolean retainsComments()
BytesComment
retainsComments
in interface BytesComment<BytesOut<ByteBuffer>>
public Bytes<ByteBuffer> comment(CharSequence comment)
BytesComment
comment
in interface BytesComment<BytesOut<ByteBuffer>>
comment
- to add (or ignore)public BytesOut indent(int n)
BytesComment
indent
in interface BytesComment<BytesOut<ByteBuffer>>
n
- +1 indent in, -1 reduce indentingpublic BytesStore copy()
copy
in interface Bytes<ByteBuffer>
copy
in interface BytesStore<Bytes<ByteBuffer>,ByteBuffer>
public boolean isElastic()
isElastic
in interface Bytes<ByteBuffer>
public void ensureCapacity(long size) throws IllegalArgumentException
Bytes
BufferOverflowException
ensureCapacity
in interface Bytes<ByteBuffer>
size
- the capacity that you requiredIllegalArgumentException
- if the buffer is not elastic and there is not enough space@NotNull public BytesStore bytesStore()
bytesStore
in interface Bytes<ByteBuffer>
bytesStore
in interface BytesStore<Bytes<ByteBuffer>,ByteBuffer>
@NotNull public Bytes compact()
Bytes
compact
in interface Bytes<ByteBuffer>
@NotNull public Bytes clear()
StreamingCommon
clear
in interface Bytes<ByteBuffer>
clear
in interface StreamingCommon<Bytes<ByteBuffer>>
public boolean isDirectMemory()
isDirectMemory
in interface BytesStore<Bytes<ByteBuffer>,ByteBuffer>
public long capacity()
capacity
in interface BytesStore<Bytes<ByteBuffer>,ByteBuffer>
public long addressForRead(long offset) throws UnsupportedOperationException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heappublic long addressForWrite(long offset) throws UnsupportedOperationException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heappublic 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
@Nullable public ByteBuffer underlyingObject()
underlyingObject
in interface BytesStore<Bytes<ByteBuffer>,ByteBuffer>
public void move(long from, long to, long length)
move
in interface BytesStore<Bytes<ByteBuffer>,ByteBuffer>
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<ByteBuffer> writeByte(long offset, byte i8) throws BufferOverflowException
RandomDataOutput
writeByte
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write toi8
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<ByteBuffer> writeShort(long offset, short i) throws BufferOverflowException
RandomDataOutput
writeShort
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<ByteBuffer> writeInt24(long offset, int i) throws BufferOverflowException
writeInt24
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull public Bytes<ByteBuffer> writeInt(long offset, int i) throws BufferOverflowException
RandomDataOutput
writeInt
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<ByteBuffer> writeOrderedInt(long offset, int i) throws BufferOverflowException
RandomDataOutput
writeOrderedInt
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write toi
- value to writeBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<ByteBuffer> writeLong(long offset, long i) throws BufferOverflowException
RandomDataOutput
writeLong
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write toi
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<ByteBuffer> writeOrderedLong(long offset, long i) throws BufferOverflowException
RandomDataOutput
writeOrderedLong
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write toi
- value to writeBufferOverflowException
@NotNull public Bytes<ByteBuffer> writeFloat(long offset, float d) throws BufferOverflowException
RandomDataOutput
writeFloat
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<ByteBuffer> writeDouble(long offset, double d) throws BufferOverflowException
RandomDataOutput
writeDouble
in interface RandomDataOutput<Bytes<ByteBuffer>>
offset
- to write tod
- the valueBufferOverflowException
- if the capacity was exceeded@NotNull public Bytes<ByteBuffer> writeVolatileByte(long offset, byte i8) throws BufferOverflowException
writeVolatileByte
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull public Bytes<ByteBuffer> writeVolatileShort(long offset, short i16) throws BufferOverflowException
writeVolatileShort
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull public Bytes<ByteBuffer> writeVolatileInt(long offset, int i32) throws BufferOverflowException
writeVolatileInt
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull public Bytes<ByteBuffer> writeVolatileLong(long offset, long i64) throws BufferOverflowException
writeVolatileLong
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull public Bytes<ByteBuffer> write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException
write
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
IllegalArgumentException
public void write(long offsetInRDO, ByteBuffer bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException
write
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
IllegalArgumentException
@NotNull public Bytes<ByteBuffer> write(long writeOffset, RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, IllegalArgumentException, BufferUnderflowException
write
in interface RandomDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
IllegalArgumentException
BufferUnderflowException
public void nativeWrite(long address, long position, long size)
RandomDataOutput
nativeWrite
in interface RandomDataOutput<Bytes<ByteBuffer>>
address
- in native memory to copy fromposition
- in BytesStore to copy tosize
- in bytes@NotNull public Bytes<ByteBuffer> readPosition(long position) throws BufferUnderflowException
readPosition
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
@NotNull public Bytes<ByteBuffer> readLimit(long limit) throws BufferUnderflowException
readLimit
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
@NotNull public Bytes<ByteBuffer> readSkip(long bytesToSkip) throws BufferUnderflowException
StreamingDataInput
readSkip
in interface StreamingDataInput<Bytes<ByteBuffer>>
bytesToSkip
- bytes to skip.BufferUnderflowException
- if the offset is outside the limits of the Bytespublic void uncheckedReadSkipOne()
StreamingDataInput
uncheckedReadSkipOne
in interface StreamingDataInput<Bytes<ByteBuffer>>
public void uncheckedReadSkipBackOne()
StreamingDataInput
uncheckedReadSkipBackOne
in interface StreamingDataInput<Bytes<ByteBuffer>>
public byte readByte()
readByte
in interface StreamingDataInput<Bytes<ByteBuffer>>
public int readUnsignedByte()
readUnsignedByte
in interface StreamingDataInput<Bytes<ByteBuffer>>
public int uncheckedReadUnsignedByte()
uncheckedReadUnsignedByte
in interface StreamingDataInput<Bytes<ByteBuffer>>
public short readShort() throws BufferUnderflowException
readShort
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
public int readInt() throws BufferUnderflowException
readInt
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
public long readLong() throws BufferUnderflowException
readLong
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
public float readFloat() throws BufferUnderflowException
readFloat
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
public double readDouble() throws BufferUnderflowException
readDouble
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
public int readVolatileInt() throws BufferUnderflowException
readVolatileInt
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
public long readVolatileLong() throws BufferUnderflowException
readVolatileLong
in interface StreamingDataInput<Bytes<ByteBuffer>>
BufferUnderflowException
public int peekUnsignedByte()
peekUnsignedByte
in interface StreamingDataInput<Bytes<ByteBuffer>>
public void nativeRead(long address, long size) throws BufferUnderflowException
StreamingDataInput
nativeRead
in interface StreamingDataInput<Bytes<ByteBuffer>>
address
- of the memory.size
- in bytes.BufferUnderflowException
public int lastDecimalPlaces()
public void lastDecimalPlaces(int lastDecimalPlaces)
lastDecimalPlaces
- set the number of decimal places if positive, otherwise 0.@NotNull public Bytes<ByteBuffer> writePosition(long position) throws BufferOverflowException
writePosition
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeLimit(long limit) throws BufferOverflowException
writeLimit
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull public Bytes<ByteBuffer> writeSkip(long bytesToSkip) throws BufferOverflowException
StreamingDataOutput
writeSkip
in interface StreamingDataOutput<Bytes<ByteBuffer>>
bytesToSkip
- bytes to skip.BufferOverflowException
- if the offset is outside the limits of the Bytes@NotNull @NotNull public Bytes<ByteBuffer> writeByte(byte i8) throws BufferOverflowException
writeByte
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
public long writePosition()
@NotNull @NotNull public Bytes<ByteBuffer> writeShort(short i16) throws BufferOverflowException
writeShort
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeInt(int i) throws BufferOverflowException
writeInt
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeIntAdv(int i, int advance) throws BufferOverflowException
writeIntAdv
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeLong(long i64) throws BufferOverflowException
writeLong
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeLongAdv(long i64, int advance) throws BufferOverflowException
writeLongAdv
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeFloat(float f) throws BufferOverflowException
writeFloat
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeDouble(double d) throws BufferOverflowException
writeDouble
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeDoubleAndInt(double d, int i) throws BufferOverflowException
writeDoubleAndInt
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> write(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
IllegalArgumentException
@NotNull @NotNull public Bytes<ByteBuffer> writeSome(ByteBuffer buffer) throws BufferOverflowException
writeSome
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeOrderedInt(int i) throws BufferOverflowException
writeOrderedInt
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
@NotNull @NotNull public Bytes<ByteBuffer> writeOrderedLong(long i) throws BufferOverflowException
writeOrderedLong
in interface StreamingDataOutput<Bytes<ByteBuffer>>
BufferOverflowException
public void nativeWrite(long address, long size) throws BufferOverflowException
StreamingDataOutput
nativeWrite
in interface StreamingDataOutput<Bytes<ByteBuffer>>
address
- to write to.size
- in bytes.BufferOverflowException
@NotNull public Bytes<ByteBuffer> clearAndPad(long length) throws BufferOverflowException
BytesPrepender
clearAndPad
in interface BytesPrepender<Bytes<ByteBuffer>>
length
- to padBufferOverflowException
- if the length > capacity() - start()@NotNull public Bytes<ByteBuffer> prewrite(byte[] bytes)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<ByteBuffer>>
bytes
- to prepend to.@NotNull public Bytes<ByteBuffer> prewrite(BytesStore bytes)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewrite
in interface BytesPrepender<Bytes<ByteBuffer>>
bytes
- to prepend to.@NotNull public Bytes<ByteBuffer> prewriteByte(byte b)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteByte
in interface BytesPrepender<Bytes<ByteBuffer>>
b
- byte to prepend to.@NotNull public Bytes<ByteBuffer> prewriteShort(short i)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteShort
in interface BytesPrepender<Bytes<ByteBuffer>>
i
- short to prepend to.@NotNull public Bytes<ByteBuffer> prewriteInt(int i)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteInt
in interface BytesPrepender<Bytes<ByteBuffer>>
i
- integer to prepend to.@NotNull public Bytes<ByteBuffer> prewriteLong(long l)
BytesPrepender
Note: it moves the readPosition not the writePosition / readLimit
prewriteLong
in interface BytesPrepender<Bytes<ByteBuffer>>
l
- long to prepend to.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)
RandomDataInput
peekUnsignedByte
in interface RandomDataInput
offset
- to readpublic 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 Bytespublic 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 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 long readPosition()
public void lenient(boolean lenient)
StreamingDataInput
lenient
in interface StreamingDataInput<Bytes<ByteBuffer>>
lenient
- if true, return nothing rather than error.public boolean lenient()
lenient
in interface StreamingDataInput<Bytes<ByteBuffer>>
@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.