public interface ByteStringParser<B extends ByteStringParser<B>> extends StreamingDataInput<B>
Modifier and Type | Method and Description |
---|---|
long |
addressForRead(long offset)
Obtain the underlying addressForRead.
|
default long |
addressForRead(long offset,
int buffer) |
long |
addressForWrite(long offset)
Obtain the underlying addressForRead.
|
long |
addressForWritePosition() |
default ByteOrder |
byteOrder() |
@NotNull Bytes<?> |
bytesForRead() |
@NotNull Bytes<?> |
bytesForWrite() |
default long |
capacity() |
boolean |
isDirectMemory() |
int |
lastDecimalPlaces() |
void |
lastDecimalPlaces(int lastDecimalPlaces)
Store the last number of decimal places.
|
boolean |
lastNumberHadDigits() |
void |
lastNumberHadDigits(boolean lastNumberHadDigits) |
default long |
lengthWritten(long startPosition)
Typically this calculates the difference however for HexDumpBytes it's not as simple.
|
default void |
parse8bit(Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Appendable buffer,
@NotNull StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(Bytes<?> buffer,
@NotNull StopCharsTester stopCharsTester) |
default String |
parse8bit(@NotNull StopCharTester stopCharTester)
parse text with ISO-8859-1 decoding as character terminated.
|
default void |
parse8bit(StringBuilder buffer,
@NotNull StopCharsTester stopCharsTester) |
default @NotNull BigDecimal |
parseBigDecimal() |
default @Nullable Boolean |
parseBoolean() |
default @Nullable Boolean |
parseBoolean(@NotNull StopCharTester tester)
Return
true or false, or null if it could not be detected
as true or false. |
default double |
parseDouble()
parse text as a double decimal.
|
default long |
parseFlexibleLong()
Parses a long in regular or scientific format.
|
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 |
parseUtf8(@NotNull Appendable buffer,
@NotNull StopCharsTester stopCharsTester)
parse text with UTF-8 decoding as one or two character terminated.
|
default void |
parseUtf8(@NotNull Appendable buffer,
@NotNull StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default @NotNull String |
parseUtf8(@NotNull StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default @NotNull Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
default long |
readLimit()
If the resource is closed, the returned value is unspecified.
|
default long |
readPosition()
Returns the read position.
|
default long |
readRemaining()
Returns the remaining bytes that can be read.
|
default long |
realCapacity() |
default long |
realReadRemaining()
If the resource is closed, the returned value is unspecified.
|
default long |
realWriteRemaining()
If the resource is closed, the returned value is unspecified.
|
boolean |
sharedMemory() |
default boolean |
skipTo(@NotNull StopCharTester tester)
Skip text until a terminating character is reached.
|
default long |
start() |
default long |
writeLimit()
Returns the write limit.
|
default long |
writePosition()
Returns the write position.
|
default long |
writeRemaining()
If the resource is closed, the returned value is unspecified.
|
copyTo, copyTo, inputStream, lenient, lenient, parseHexLong, parseUtf8, parseUtf8, peekUnsignedByte, rawReadByte, rawReadInt, rawReadLong, read, read, read, read, read, read, read8bit, read8bit, read8bit, readBigDecimal, readBigInteger, readBoolean, readByte, readChar, readDouble, readEnum, readFloat, readHistogram, readIncompleteLong, readInt, readInt24, readLimit, readLimitToCapacity, readLong, readPosition, readPositionForHeader, readPositionRemaining, readPositionUnlimited, readShort, readSkip, readStopBit, readStopBitChar, readStopBitDecimal, readStopBitDouble, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUtf8, readUtf8, readVolatileInt, readVolatileLong, readWithLength, readWithLength, readWithLength0, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, unsafeRead, unsafeReadObject, unsafeReadObject
clear
@NotNull default @NotNull Reader reader()
@Nullable default @Nullable Boolean parseBoolean(@NotNull @NotNull StopCharTester tester) throws BufferUnderflowException, IllegalStateException, ArithmeticException
true
or false, or null if it could not be detected
as true
or false. Case is not important
false: f, false, n, no, 0
true: t, true, y, yes, 1
tester
- to detect the end of the text.BufferUnderflowException
IllegalStateException
ArithmeticException
@Nullable default @Nullable Boolean parseBoolean() throws BufferUnderflowException, IllegalStateException, ArithmeticException
@NotNull default @NotNull String parseUtf8(@NotNull @NotNull StopCharTester stopCharTester) throws IllegalStateException, ArithmeticException
stopCharTester
- to check if the end has been reached.IllegalStateException
ArithmeticException
default void parseUtf8(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, IllegalStateException, ArithmeticException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
IllegalStateException
ArithmeticException
default void parseUtf8(@NotNull @NotNull Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
default void parse8bit(Appendable buffer, @NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, BufferOverflowException, IllegalStateException, ArithmeticException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
IllegalStateException
ArithmeticException
default String parse8bit(@NotNull @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, IllegalStateException
stopCharTester
- to check if the end has been reached.BufferUnderflowException
IllegalStateException
default void parse8bit(Appendable buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, IllegalStateException, ArithmeticException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
IllegalStateException
ArithmeticException
default void parse8bit(Bytes<?> buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, IllegalStateException, ArithmeticException
default void parse8bit(StringBuilder buffer, @NotNull @NotNull StopCharsTester stopCharsTester) throws IllegalStateException
IllegalStateException
default int parseInt() throws BufferUnderflowException, ArithmeticException, IllegalStateException
BufferUnderflowException
ArithmeticException
IllegalStateException
default long parseLong() throws BufferUnderflowException, IllegalStateException
BufferUnderflowException
IllegalStateException
default long parseFlexibleLong() throws BufferUnderflowException, IllegalStateException, net.openhft.chronicle.core.io.IORuntimeException
parseDouble()
casted to long).net.openhft.chronicle.core.io.IORuntimeException
- if text parses to a fractional number or to a number outside of the long's range.BufferUnderflowException
IllegalStateException
default float parseFloat() throws BufferUnderflowException, IllegalStateException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
IllegalStateException
default double parseDouble() throws BufferUnderflowException, IllegalStateException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
IllegalStateException
default long parseLongDecimal() throws BufferUnderflowException, IllegalStateException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
IllegalStateException
int lastDecimalPlaces()
void lastDecimalPlaces(int lastDecimalPlaces)
lastDecimalPlaces
- set the number of decimal places if positive, otherwise 0.boolean lastNumberHadDigits()
void lastNumberHadDigits(boolean lastNumberHadDigits)
lastNumberHadDigits
- set the last number had digitsdefault boolean skipTo(@NotNull @NotNull StopCharTester tester) throws IllegalStateException
tester
- to stop atIllegalStateException
@NotNull default @NotNull BigDecimal parseBigDecimal() throws IllegalStateException, ArithmeticException
default long start()
default long capacity()
default long realCapacity()
default long readPosition()
The read position is start() <= readPosition() && readPosition() <= readLimit() && readPosition < safeLimit()
If the resource is closed, the returned value is unspecified.
default long writePosition()
The write position is readPosition() <= writePosition() && writePosition() <= writeLimit()
If the resource is closed, the returned value is unspecified.
default long lengthWritten(long startPosition)
If the resource is closed, the returned value is unspecified.
startPosition
- to compare againstdefault long readRemaining()
If the resource is closed, the returned value is unspecified.
default long realReadRemaining()
If the resource is closed, the returned value is unspecified.
default long writeRemaining()
If the resource is closed, the returned value is unspecified.
default long realWriteRemaining()
If the resource is closed, the returned value is unspecified.
default long readLimit()
If the resource is closed, the returned value is unspecified.
default long writeLimit()
If the resource is closed, the returned value is unspecified.
long addressForRead(long offset) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferUnderflowException
- if the offset is before the start() or the after the capacity()IllegalStateException
default long addressForRead(long offset, int buffer) throws UnsupportedOperationException, BufferUnderflowException, IllegalStateException
long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException, IllegalStateException
offset
- within this buffer. addressForRead(start()) is the actual addressForRead of the first byte.UnsupportedOperationException
- if the underlying buffer is on the heapBufferOverflowException
- if the offset is before the start() or the after the capacity()IllegalStateException
long addressForWritePosition() throws UnsupportedOperationException, BufferOverflowException, IllegalStateException
default ByteOrder byteOrder()
@NotNull @NotNull Bytes<?> bytesForRead() throws IllegalStateException
IllegalStateException
@NotNull @NotNull Bytes<?> bytesForWrite() throws IllegalStateException
IllegalStateException
boolean sharedMemory()
boolean isDirectMemory()
Copyright © 2023. All rights reserved.