public class VanillaBytes<Underlying> extends AbstractBytes<Underlying> implements Byteable<Bytes<Underlying>,Underlying>, Comparable<CharSequence>
bytesStore, isPresent, readPosition, writeLimit, writePosition
DEFAULT_BYTE_BUFFER_CAPACITY, MAX_BYTE_BUFFER_CAPACITY, MAX_CAPACITY
charToString
JAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16
Constructor and Description |
---|
VanillaBytes(BytesStore bytesStore) |
VanillaBytes(BytesStore bytesStore,
long writePosition,
long writeLimit) |
Modifier and Type | Method and Description |
---|---|
VanillaBytes |
append(CharSequence str,
int start,
int end)
Append a portion of a String to the Bytes in UTF-8.
|
Bytes<Underlying> |
append8bit(CharSequence cs)
Append a String to the Bytes in ISO-8859-1
|
Bytes<Underlying> |
append8bit(String cs) |
protected Bytes<Underlying> |
append8bit0(CharSequence cs) |
Bytes<Underlying> |
appendUtf8(char[] chars,
int offset,
int length) |
VanillaBytes |
appendUtf8(CharSequence str) |
int |
byteCheckSum(int start,
int end) |
Bytes<Underlying> |
bytesForRead()
Creates a slice of the current Bytes based on its position() and limit().
|
void |
bytesStore(BytesStore<Bytes<Underlying>,Underlying> byteStore,
long offset,
long length)
This setter for a data type which points to an underlying ByteStore.
|
int |
compareTo(CharSequence cs) |
BytesStore<Bytes<Underlying>,Underlying> |
copy() |
boolean |
equalBytes(BytesStore bytesStore,
long length)
Check if a portion of a BytesStore matches this one.
|
boolean |
isElastic() |
boolean |
isEqual(String s) |
long |
maxSize() |
long |
offset() |
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 void |
parse8bit(StringBuilder buffer,
StopCharsTester stopCharsTester) |
default BigDecimal |
parseBigDecimal() |
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 |
read(byte[] bytes) |
void |
read8Bit(char[] chars,
int length) |
default Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
long |
readVolatileLong(long offset)
Read a 64-bit long from memory with a load barrier.
|
long |
realCapacity() |
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
String |
toString() |
protected String |
toString0() |
ByteBuffer |
toTemporaryDirectByteBuffer() |
static VanillaBytes<Void> |
vanillaBytes() |
Bytes<Underlying> |
write(BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
void |
write(long position,
CharSequence str,
int offset,
int length) |
addressForRead, addressForWrite, byteCheckSum, byteCheckSum, bytesStore, capacity, clear, clearAndPad, compact, compareAndSwapInt, compareAndSwapLong, equals, equalsBytes, hashCode, isDirectMemory, isPresent, isPresent, lastDecimalPlaces, lastDecimalPlaces, lenient, lenient, move, nativeRead, nativeRead, nativeWrite, nativeWrite, peekUnsignedByte, peekUnsignedByte, prewrite, prewrite, prewriteByte, prewriteInt, prewriteLong, prewriteOffsetPositionMoved, prewriteShort, readByte, readByte, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLimit, readLimit, readLong, readLong, readOffsetPositionMoved, readPosition, readPosition, readShort, readShort, readSkip, readUnsignedByte, readUnsignedByte, readVolatileByte, readVolatileInt, readVolatileInt, readVolatileLong, readVolatileShort, refCount, release, reserve, start, tryReserve, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, underlyingObject, write, write, write, write, writeByte, writeByte, writeCheckOffset0, writeDouble, writeDouble, writeDoubleAndInt, writeFloat, writeFloat, writeInt, writeInt, writeIntAdv, writeLimit, writeLimit, writeLong, writeLong, writeLongAdv, writeOffsetPositionMoved, writeOffsetPositionMoved, writeOrderedInt, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writePosition, writeShort, writeShort, writeSkip, writeSome, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShort
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
bytesStore
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, copyTo, copyTo, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, ensureCapacity, from, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, 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, 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
append, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloat
chars, codePoints
bytesMethodReader, bytesMethodReaderBuilder
inputStream, parseHexLong, parseUTF, parseUtf8, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readEnum, readHistogram, readPositionRemaining, readPositionUnlimited, readStopBit, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength, readWithLength, readWithLength0
bytesMethodWriter, bytesMethodWriterBuilder
append, append, append, append, append, append, append, append, append8bit, appendBase, appendBase16, appendDateMillis, appendDecimal, appendTimeMillis, writer
appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, write, write, write, write, write8bit, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeEnum, writeHistogram, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8, writeUTFΔ, writeWithLength
prepend
comment, indent, retainsComments
public VanillaBytes(@NotNull BytesStore bytesStore) throws IllegalStateException
IllegalStateException
public VanillaBytes(@NotNull BytesStore bytesStore, long writePosition, long writeLimit) throws IllegalStateException
IllegalStateException
@NotNull public static VanillaBytes<Void> vanillaBytes()
public long readVolatileLong(long offset) throws BufferUnderflowException
RandomDataInput
readVolatileLong
in interface RandomDataInput
readVolatileLong
in class AbstractBytes<Underlying>
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the Bytespublic void bytesStore(@NotNull BytesStore<Bytes<Underlying>,Underlying> byteStore, long offset, long length) throws IllegalStateException, BufferOverflowException, BufferUnderflowException
Byteable
bytesStore
in interface Byteable<Bytes<Underlying>,Underlying>
byteStore
- the fix point ByteStoreoffset
- the offset within the ByteStorelength
- the length in the ByteStoreIllegalStateException
BufferOverflowException
BufferUnderflowException
public long offset()
offset
in interface Byteable<Bytes<Underlying>,Underlying>
public long maxSize()
maxSize
in interface Byteable<Bytes<Underlying>,Underlying>
public boolean isElastic()
isElastic
in interface Bytes<Underlying>
@NotNull public Bytes<Underlying> bytesForRead() throws IllegalStateException
Bytes
bytesForRead
in interface Bytes<Underlying>
bytesForRead
in interface BytesStore<Bytes<Underlying>,Underlying>
IllegalStateException
- if the underlying BytesStore has been releasedpublic boolean isEqual(@Nullable String s)
isEqual
in interface Bytes<Underlying>
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>>
realCapacity
in class AbstractBytes<Underlying>
@NotNull public BytesStore<Bytes<Underlying>,Underlying> copy()
copy
in interface Bytes<Underlying>
copy
in interface BytesStore<Bytes<Underlying>,Underlying>
@NotNull public Bytes<Underlying> write(@NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException, IllegalArgumentException
StreamingDataOutput
write
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
BufferUnderflowException
IllegalArgumentException
public void write(long position, @NotNull CharSequence str, int offset, int length) throws BufferOverflowException, IllegalArgumentException
@NotNull public VanillaBytes append(@NotNull CharSequence str, int start, int end) throws IndexOutOfBoundsException
ByteStringAppender
append
in interface Appendable
append
in interface ByteStringAppender<Bytes<Underlying>>
str
- to copystart
- index of the first char inclusiveend
- index of the last char exclusive.IndexOutOfBoundsException
@NotNull public VanillaBytes appendUtf8(CharSequence str) throws BufferOverflowException
appendUtf8
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
@NotNull public Bytes<Underlying> append8bit(@NotNull CharSequence cs) throws BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException
ByteStringAppender
append8bit
in interface ByteStringAppender<Bytes<Underlying>>
cs
- to writeBufferOverflowException
- If the string as too large to write in the capacity availableBufferUnderflowException
- if the capacity of the underlying buffer was exceededIndexOutOfBoundsException
@NotNull public Bytes<Underlying> append8bit(@NotNull String cs) throws BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException
append8bit
in interface ByteStringAppender<Bytes<Underlying>>
BufferOverflowException
BufferUnderflowException
IndexOutOfBoundsException
@NotNull public String toString()
toString
in interface CharSequence
toString
in class AbstractBytes<Underlying>
@NotNull protected String toString0()
@NotNull protected Bytes<Underlying> append8bit0(@NotNull CharSequence cs) throws BufferOverflowException, IndexOutOfBoundsException
public boolean equalBytes(BytesStore bytesStore, long length) throws BufferUnderflowException
BytesStore
equalBytes
in interface BytesStore<Bytes<Underlying>,Underlying>
bytesStore
- to match againstlength
- to match.BufferUnderflowException
public void read8Bit(char[] chars, int length)
public int byteCheckSum(int start, int end) throws net.openhft.chronicle.core.io.IORuntimeException
byteCheckSum
in class AbstractBytes<Underlying>
net.openhft.chronicle.core.io.IORuntimeException
@NotNull public Bytes<Underlying> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException
appendUtf8
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
public ByteBuffer toTemporaryDirectByteBuffer() throws IllegalArgumentException
toTemporaryDirectByteBuffer
in interface RandomDataInput
IllegalArgumentException
public int read(@NotNull byte[] bytes)
read
in interface StreamingDataInput<Bytes<Underlying>>
public int compareTo(@NotNull CharSequence cs)
compareTo
in interface Comparable<CharSequence>
@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.@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 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 long parseLong() throws BufferUnderflowException
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.