public class NativeBytes<Underlying> extends VanillaBytes<Underlying>
bytesStore, readPosition, writeLimit, writePosition
MAX_CAPACITY
charToString
Modifier and Type | Method and Description |
---|---|
default ByteOrder |
byteOrder() |
long |
capacity() |
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.
|
static BytesStore<Bytes<Void>,Void> |
copyOf(Bytes bytes) |
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 |
boolean |
isElastic() |
static NativeBytes<Void> |
nativeBytes() |
static NativeBytes<Void> |
nativeBytes(long initialCapacity) |
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 void |
parseUTF(Appendable buffer,
StopCharsTester stopCharsTester)
parse text with UTF-8 decoding as one or two character terminated.
|
default void |
parseUTF(Appendable buffer,
StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default String |
parseUTF(StopCharTester stopCharTester)
parse text with UTF-8 decoding as character terminated.
|
default Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
long |
readIncompleteLong(long offset)
Read a long which is zero padded (high bytes) if the available bytes is less than 8.
|
default long |
readRemaining() |
int |
readVolatileInt(long offset)
Read a 32-bit int from memory with a load barrier.
|
long |
readVolatileLong(long offset)
Read a 64-bit long from memory with a load barrier.
|
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
Bytes<Underlying> |
write(byte[] bytes,
int offset,
int length) |
Bytes<Underlying> |
write(BytesStore bytes,
long offset,
long length) |
protected void |
writeCheckOffset(long offset,
long adding) |
default long |
writeRemaining() |
append, appendUtf8, byteCheckSum, bytesForRead, bytesStore, copy, equalBytes, isEqual, maxSize, offset, read8Bit, realCapacity, vanillaBytes, write, write8bit
address, bytesStore, clear, clearAndPad, compareAndSwapInt, compareAndSwapLong, equals, equalsBytes, hashCode, 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, writeByte, writeByte, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLimit, writeLimit, writeLong, writeLong, writeOffsetPositionMoved, writeOrderedInt, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writePosition, writeShort, writeShort, writeSkip
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
bytesStore
allocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, elasticByteBuffer, empty, expect, expect, from, isClear, safeLimit, toHexString, toHexString, toHexString, toString, toString, unchecked, wrapForRead, wrapForRead, wrapForRead, wrapForWrite, wrapForWrite
addAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, bytesForWrite, charAt, contentEquals, copyTo, endsWith, inside, length, longCheckSum, nativePointer, startsWith, subSequence, to8bitString, toDebugString, wrap, wrap, wrap, wrap, zeroOut
addAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, copyTo, createCharToString, findByte, parseLong, printable, readBoolean, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes
append, write, write, writeBoolean, writeByte, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited
chars, codePoints
copyTo, inputStream, parseUTF, parseWithLength, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readEnum, readStopBit, readStopBitDouble, readUnsignedInt, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength, toByteArray
append, append, append, append, append, append8bit, append8bit, appendDateMillis, 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
prepend
@NotNull public static NativeBytes<Void> nativeBytes()
@NotNull public static NativeBytes<Void> nativeBytes(long initialCapacity) throws IllegalArgumentException
IllegalArgumentException
public static BytesStore<Bytes<Void>,Void> copyOf(@NotNull Bytes bytes)
public long capacity()
capacity
in interface BytesStore<Bytes<Underlying>,Underlying>
capacity
in class AbstractBytes<Underlying>
protected void writeCheckOffset(long offset, long adding) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
public void ensureCapacity(long size) throws IllegalArgumentException, IORuntimeException
Bytes
BufferOverflowException
size
- the capacity that you requiredIllegalArgumentException
- if the buffer is not elastic and there is not enough spaceIORuntimeException
- if an error occured trying to resize the underlying buffer.public int readVolatileInt(long offset) throws BufferUnderflowException, IORuntimeException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.public long readVolatileLong(long offset) throws BufferUnderflowException, IORuntimeException
RandomDataInput
offset
- to readBufferUnderflowException
- if the offset is outside the limits of the BytesIORuntimeException
- if an error occurred trying to obtain the data.public boolean isElastic()
isElastic
in interface Bytes<Underlying>
isElastic
in class VanillaBytes<Underlying>
public long readIncompleteLong(long offset) throws IORuntimeException
RandomDataInput
offset
- to read fromIORuntimeException
- if an error occurred trying to obtain the data.@NotNull public Bytes<Underlying> write(byte[] bytes, int offset, int length) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
write
in interface StreamingDataOutput<Bytes<Underlying>>
write
in class AbstractBytes<Underlying>
BufferOverflowException
IllegalArgumentException
IORuntimeException
@NotNull public Bytes<Underlying> write(BytesStore bytes, long offset, long length) throws BufferOverflowException, IllegalArgumentException, BufferUnderflowException, IORuntimeException
write
in interface StreamingDataOutput<Bytes<Underlying>>
write
in class VanillaBytes<Underlying>
BufferOverflowException
IllegalArgumentException
BufferUnderflowException
IORuntimeException
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 parseUTF(@NotNull StopCharTester stopCharTester)
stopCharTester
- to check if the end has been reached.public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharTester stopCharTester)
buffer
- to populatestopCharTester
- to check if the end has been reached.public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, IORuntimeException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
IORuntimeException
public void parse8bit(Appendable buffer, @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, BufferOverflowException, IORuntimeException
buffer
- to populatestopCharTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
IORuntimeException
public void parse8bit(Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, IORuntimeException
buffer
- to populatestopCharsTester
- to check if the end has been reached.BufferUnderflowException
BufferOverflowException
IORuntimeException
public long parseLong() throws BufferUnderflowException, IORuntimeException
BufferUnderflowException
IORuntimeException
public double parseDouble() throws BufferUnderflowException, IORuntimeException
BufferUnderflowException
IORuntimeException
public boolean skipTo(@NotNull StopCharTester tester) throws IORuntimeException
tester
- to stop atIORuntimeException
public long readRemaining()
public long writeRemaining()
public ByteOrder byteOrder()
public boolean compareAndSwapFloat(long offset, float expected, float value) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
IORuntimeException
public boolean compareAndSwapDouble(long offset, double expected, double value) throws BufferOverflowException, IllegalArgumentException, IORuntimeException
offset
- to perform CASexpected
- valuevalue
- to setBufferOverflowException
IllegalArgumentException
IORuntimeException
Copyright © 2015. All rights reserved.