public class VanillaBytes<Underlying> extends AbstractBytes<Underlying> implements Byteable<Bytes<Underlying>,Underlying>
bytesStore, readPosition, writeLimit, writePosition
MAX_CAPACITY
charToString
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.
|
VanillaBytes<Underlying> |
appendUtf8(char[] chars,
int offset,
int length) |
int |
byteCheckSum()
Return the bytes sum of the readable bytes.
|
default ByteOrder |
byteOrder() |
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.
|
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.
|
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 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.
|
void |
read8Bit(char[] chars,
int length) |
default Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
default long |
readRemaining() |
long |
realCapacity() |
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
ByteBuffer |
toTemporaryDirectByteBuffer() |
static VanillaBytes<Void> |
vanillaBytes() |
Bytes<Underlying> |
write(BytesStore bytes,
long offset,
long length) |
void |
write(long position,
CharSequence str,
int offset,
int length) |
Bytes<Underlying> |
write8bit(CharSequence str,
int offset,
int length) |
default long |
writeRemaining() |
address, bytesStore, capacity, clear, clearAndPad, compareAndSwapInt, compareAndSwapLong, equals, equalsBytes, hashCode, lastDecimalPlaces, lastDecimalPlaces, nativeRead, nativeRead, nativeWrite, nativeWrite, peekUnsignedByte, 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, readVolatileInt, readVolatileLong, refCount, release, reserve, start, toString, underlyingObject, write, write, write, write, write, writeByte, writeByte, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLimit, writeLimit, writeLong, writeLong, writeOffsetPositionMoved, writeOrderedInt, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writePosition, writeShort, writeShort, writeSkip, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShort
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
bytesStore
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, empty, ensureCapacity, expect, expect, from, fromHexString, isClear, safeLimit, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, wrapForRead, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, bytesForWrite, charAt, contentEquals, copyTo, copyTo, endsWith, inside, isNative, 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
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, append8bit, append8bit, appendDateMillis, appendDecimal, appendTimeMillis, writer
appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, write, write, write, write, write8bit, write8bit, write8bit, writeBoolean, writeEnum, writeStopBit, writeStopBit, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUTFΔ
close, release, releaseAll, tryReserve
closeQuietly, notifyClosing
prepend
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 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(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 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, net.openhft.chronicle.core.io.IORuntimeException
write
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
BufferUnderflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public Bytes<Underlying> write8bit(@NotNull CharSequence str, int offset, int length) throws BufferOverflowException, IllegalArgumentException, IndexOutOfBoundsException, net.openhft.chronicle.core.io.IORuntimeException
write8bit
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
IndexOutOfBoundsException
net.openhft.chronicle.core.io.IORuntimeException
public void write(long position, @NotNull CharSequence str, int offset, int length) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
@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
public boolean equalBytes(BytesStore bytesStore, long length) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
BytesStore
equalBytes
in interface BytesStore<Bytes<Underlying>,Underlying>
bytesStore
- to match againstlength
- to match.BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public void read8Bit(char[] chars, int length)
public int byteCheckSum() throws net.openhft.chronicle.core.io.IORuntimeException
BytesStore
byteCheckSum
in interface BytesStore<Bytes<Underlying>,Underlying>
net.openhft.chronicle.core.io.IORuntimeException
public VanillaBytes<Underlying> appendUtf8(char[] chars, int offset, int length) throws BufferOverflowException, IllegalArgumentException, net.openhft.chronicle.core.io.IORuntimeException
appendUtf8
in interface StreamingDataOutput<Bytes<Underlying>>
BufferOverflowException
IllegalArgumentException
net.openhft.chronicle.core.io.IORuntimeException
public ByteBuffer toTemporaryDirectByteBuffer()
toTemporaryDirectByteBuffer
in interface RandomDataInput
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
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowException
net.openhft.chronicle.core.io.IORuntimeException
public long parseLongDecimal() throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
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 © 2016. All rights reserved.