public class MappedBytes extends AbstractBytes<Void> implements net.openhft.chronicle.core.io.Closeable
bytesStore, isPresent, readPosition, writeLimit, writePositionDEFAULT_BYTE_BUFFER_CAPACITY, MAX_BYTE_BUFFER_CAPACITY, MAX_CAPACITYcharToStringJAVA9_STRING_CODER_LATIN, JAVA9_STRING_CODER_UTF16| Modifier | Constructor and Description |
|---|---|
protected |
MappedBytes(MappedFile mappedFile) |
protected |
MappedBytes(MappedFile mappedFile,
String name) |
| Modifier and Type | Method and Description |
|---|---|
Bytes<Void> |
append8bit(CharSequence cs,
int start,
int end)
Append a portion of a String to the Bytes in ISO-8859-1
|
Bytes<Void> |
appendUtf8(CharSequence cs,
int start,
int length) |
MappedBytesStore |
bytesStore() |
long |
capacity() |
Bytes<Void> |
clear()
Set the readPosition= writePosition = start, writeLimit = capacity
|
void |
close() |
BytesStore<Bytes<Void>,Void> |
copy() |
boolean |
isBackingFileReadOnly() |
boolean |
isClosed() |
boolean |
isElastic() |
static MappedBytes |
mappedBytes(File file,
long chunkSize) |
static MappedBytes |
mappedBytes(File file,
long chunkSize,
long overlapSize) |
static MappedBytes |
mappedBytes(File file,
long chunkSize,
long overlapSize,
boolean readOnly) |
static MappedBytes |
mappedBytes(MappedFile rw) |
static MappedBytes |
mappedBytes(String filename,
long chunkSize) |
MappedFile |
mappedFile() |
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 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 |
peekVolatileInt() |
protected void |
performRelease() |
void |
rawCopy(BytesStore bytes,
long offset,
long length) |
protected void |
readCheckOffset(long offset,
long adding,
boolean given) |
default Reader |
reader()
Access these bytes as an ISO-8859-1 encoded Reader
|
static MappedBytes |
readOnly(File file) |
Bytes<Void> |
readPosition(long position) |
Bytes<Void> |
readPositionRemaining(long position,
long remaining) |
byte |
readVolatileByte(long offset)
Read a 8-bit byte from memory with a load barrier.
|
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.
|
short |
readVolatileShort(long offset)
Read a 16-bit short from memory with a load barrier.
|
long |
realCapacity() |
void |
setNewChunkListener(NewChunkListener listener) |
boolean |
sharedMemory() |
default boolean |
skipTo(StopCharTester tester)
Skip text until a terminating character is reached.
|
long |
start() |
MappedBytes |
withSizes(long chunkSize,
long overlapSize) |
MappedBytes |
write(BytesStore bytes)
Write all data or fail.
|
Bytes<Void> |
write(BytesStore bytes,
long offset,
long length)
Write all data or fail.
|
MappedBytes |
write8bit(CharSequence s,
int start,
int length) |
Bytes<Void> |
writeByte(byte i8) |
protected void |
writeCheckOffset(long offset,
long adding) |
Bytes<Void> |
writeOrderedInt(long offset,
int i)
Perform a non stalling write with a store barrier.
|
Bytes<Void> |
writePosition(long position) |
Bytes<Void> |
writeUtf8(String s) |
address, clearAndPad, compact, compareAndSwapInt, compareAndSwapLong, equals, equalsBytes, hashCode, isDirectMemory, isPresent, isPresent, lastDecimalPlaces, lastDecimalPlaces, 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, readShort, readShort, readSkip, readUnsignedByte, readVolatileInt, readVolatileLong, refCount, release, reserve, toString, uncheckedReadSkipBackOne, uncheckedReadSkipOne, uncheckedReadUnsignedByte, underlyingObject, write, write, write, write, writeByte, writeCheckOffset0, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeIntAdv, writeLimit, writeLimit, writeLong, writeLong, writeLongAdv, writeOffsetPositionMoved, writeOffsetPositionMoved, writeOrderedInt, writeOrderedLong, writeOrderedLong, writePosition, writeShort, writeShort, writeSkip, writeSome, writeVolatileByte, writeVolatileInt, writeVolatileLong, writeVolatileShortclone, finalize, getClass, notify, notifyAll, wait, wait, waitcloseQuietly, closeQuietly, notifyClosingallocateDirect, allocateDirect, allocateElasticDirect, allocateElasticDirect, bytesForRead, copyTo, copyTo, elasticByteBuffer, elasticByteBuffer, elasticByteBuffer, elasticHeapByteBuffer, ensureCapacity, from, fromHexString, fromString, indexOf, indexOf, indexOf, indexOf, isClear, isEqual, readBigDecimal, readBigInteger, readWithLength, readWrite, safeLimit, toHexString, toHexString, toHexString, toString, toString, toString, unchecked, unchecked, unwrite, wrapForRead, wrapForRead, wrapForWrite, wrapForWriteaddAndGetByteNotAtomic, addAndGetDoubleNotAtomic, addAndGetFloatNotAtomic, addAndGetIntNotAtomic, addAndGetLongNotAtomic, addAndGetShortNotAtomic, addAndGetUnsignedByteNotAtomic, addAndGetUnsignedIntNotAtomic, addAndGetUnsignedShortNotAtomic, byteCheckSum, bytesForWrite, charAt, cipher, cipher, contentEquals, empty, endsWith, equalBytes, inside, isEmpty, length, longCheckSum, nativePointer, startsWith, startsWith, subSequence, to8bitString, toDebugString, toDebugString, wrap, wrap, wrap, writeMaxLong, zeroOutaddAndGetDouble, addAndGetFloat, addAndGetInt, addAndGetLong, compareUtf8, copyTo, copyTo, createCharToString, fastHash, findByte, parseLong, printable, read, readBoolean, readIncompleteLong, readUnsignedByte, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8Limited, readUtf8Limited, readVolatileDouble, readVolatileFloat, subBytes, toByteArray, toTemporaryDirectByteBufferappend, append, write, write, writeBoolean, writeByte, writeInt24, writeOrderedDouble, writeOrderedFloat, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUtf8Limited, writeVolatileDouble, writeVolatileFloatchars, codePointsinputStream, parseHexLong, parseUTF, parseUtf8, read, read, read, read, read8bit, read8bit, read8bit, read8bit, readBoolean, readEnum, readHistogram, readPositionUnlimited, readStopBit, readStopBitDecimal, readStopBitDouble, readUnsignedInt, readUnsignedInt24, readUnsignedShort, readUtf8, readUtf8, readUTFΔ, readUTFΔ, readWithLength, readWithLengthappend, append, append, append, append, append, append, append, append8bit, append8bit, appendBase, appendDateMillis, appendDecimal, appendTimeMillis, writerappendUtf8, appendUtf8, appendUtf8, appendUtf8, appendUtf8, copyFrom, outputStream, write, write, write, write8bit, write8bit, write8bit, writeBigDecimal, writeBigInteger, writeBoolean, writeEnum, writeHistogram, writeInt24, writePositionRemaining, writeSome, writeStopBit, writeStopBit, writeStopBitDecimal, writeUnsignedByte, writeUnsignedInt, writeUnsignedShort, writeUtf8, writeUTFΔ, writeWithLengthprependprotected MappedBytes(@NotNull
MappedFile mappedFile)
throws IllegalStateException
IllegalStateExceptionprotected MappedBytes(@NotNull
MappedFile mappedFile,
String name)
throws IllegalStateException
IllegalStateException@NotNull public static MappedBytes mappedBytes(@NotNull String filename, long chunkSize) throws FileNotFoundException, IllegalStateException
@NotNull public static MappedBytes mappedBytes(@NotNull File file, long chunkSize) throws FileNotFoundException, IllegalStateException
@NotNull public static MappedBytes mappedBytes(@NotNull File file, long chunkSize, long overlapSize) throws FileNotFoundException, IllegalStateException
@NotNull public static MappedBytes mappedBytes(@NotNull File file, long chunkSize, long overlapSize, boolean readOnly) throws FileNotFoundException, IllegalStateException
@NotNull public static MappedBytes mappedBytes(@NotNull MappedFile rw)
@NotNull public static MappedBytes readOnly(@NotNull File file) throws FileNotFoundException
FileNotFoundExceptionpublic void setNewChunkListener(NewChunkListener listener)
@NotNull public MappedFile mappedFile()
@NotNull public MappedBytes withSizes(long chunkSize, long overlapSize)
public BytesStore<Bytes<Void>,Void> copy()
public long capacity()
capacity in interface BytesStore<Bytes<Void>,Void>capacity in class AbstractBytes<Void>public long realCapacity()
realCapacity in interface Bytes<Void>realCapacity in interface BytesStore<Bytes<Void>,Void>realCapacity in interface RandomDataInputrealCapacity in interface StreamingDataOutput<Bytes<Void>>realCapacity in class AbstractBytes<Void>@NotNull public Bytes<Void> readPositionRemaining(long position, long remaining) throws BufferUnderflowException
readPositionRemaining in interface StreamingDataInput<Bytes<Void>>BufferUnderflowException@NotNull public Bytes<Void> readPosition(long position) throws BufferUnderflowException
readPosition in interface StreamingDataInput<Bytes<Void>>readPosition in class AbstractBytes<Void>BufferUnderflowExceptionprotected void readCheckOffset(long offset,
long adding,
boolean given)
throws BufferUnderflowException
BufferUnderflowExceptionprotected void writeCheckOffset(long offset,
long adding)
throws BufferOverflowException
BufferOverflowException@Nullable public MappedBytesStore bytesStore()
bytesStore in interface Bytes<Void>bytesStore in interface BytesStore<Bytes<Void>,Void>bytesStore in class AbstractBytes<Void>public long start()
start in class AbstractBytes<Void>@NotNull public Bytes<Void> writePosition(long position) throws BufferOverflowException
writePosition in interface StreamingDataOutput<Bytes<Void>>writePosition in class AbstractBytes<Void>BufferOverflowException@NotNull public Bytes<Void> clear()
StreamingCommonclear in interface Bytes<Void>clear in interface StreamingCommon<Bytes<Void>>clear in class AbstractBytes<Void>@NotNull public Bytes<Void> writeByte(byte i8) throws BufferOverflowException
writeByte in interface StreamingDataOutput<Bytes<Void>>writeByte in class AbstractBytes<Void>BufferOverflowExceptionprotected void performRelease()
public boolean isElastic()
public boolean isBackingFileReadOnly()
@NotNull public Bytes<Void> write(@NotNull BytesStore bytes, long offset, long length) throws BufferUnderflowException, BufferOverflowException
StreamingDataOutputwrite in interface StreamingDataOutput<Bytes<Void>>BufferUnderflowExceptionBufferOverflowExceptionpublic void rawCopy(@NotNull
BytesStore bytes,
long offset,
long length)
throws BufferOverflowException,
BufferUnderflowException
@NotNull public Bytes<Void> append8bit(@NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException
ByteStringAppenderappend8bit in interface ByteStringAppender<Bytes<Void>>cs - to copystart - index of the first char inclusiveend - index of the last char exclusive.BufferOverflowException - If the string as too large to write in the capacity availableBufferUnderflowException - if the capacity of the underlying buffer was exceededIndexOutOfBoundsException - if the start or the end are not valid for the CharSequenceIllegalArgumentException@NotNull public Bytes<Void> writeUtf8(String s) throws BufferOverflowException
writeUtf8 in interface StreamingDataOutput<Bytes<Void>>BufferOverflowException@NotNull public MappedBytes write8bit(CharSequence s, int start, int length)
write8bit in interface StreamingDataOutput<Bytes<Void>>@NotNull public Bytes<Void> appendUtf8(CharSequence cs, int start, int length) throws BufferOverflowException, IllegalArgumentException
appendUtf8 in interface StreamingDataOutput<Bytes<Void>>BufferOverflowExceptionIllegalArgumentExceptionpublic boolean sharedMemory()
sharedMemory in interface Bytes<Void>@NotNull public Bytes<Void> writeOrderedInt(long offset, int i) throws BufferOverflowException
RandomDataOutputwriteOrderedInt in interface RandomDataOutput<Bytes<Void>>writeOrderedInt in class AbstractBytes<Void>offset - to write toi - value to writeBufferOverflowException - if the capacity was exceededpublic byte readVolatileByte(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileByte in interface RandomDataInputreadVolatileByte in class AbstractBytes<Void>offset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic short readVolatileShort(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileShort in interface RandomDataInputreadVolatileShort in class AbstractBytes<Void>offset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic int readVolatileInt(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileInt in interface RandomDataInputreadVolatileInt in class AbstractBytes<Void>offset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic long readVolatileLong(long offset)
throws BufferUnderflowException
RandomDataInputreadVolatileLong in interface RandomDataInputreadVolatileLong in class AbstractBytes<Void>offset - to readBufferUnderflowException - if the offset is outside the limits of the Bytespublic int peekVolatileInt()
peekVolatileInt in interface RandomDataInputpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
@NotNull public MappedBytes write(@NotNull BytesStore bytes) throws BufferOverflowException
StreamingDataOutputwrite in interface StreamingDataOutput<Bytes<Void>>BufferOverflowException@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)
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.BufferUnderflowExceptionBufferOverflowExceptionnet.openhft.chronicle.core.io.IORuntimeException@Deprecated public void parseUTF(@NotNull Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException, net.openhft.chronicle.core.io.IORuntimeException
BufferUnderflowExceptionBufferOverflowExceptionnet.openhft.chronicle.core.io.IORuntimeExceptionpublic void parse8bit(Appendable buffer, @NotNull StopCharTester stopCharTester) throws BufferUnderflowException, BufferOverflowException
buffer - to populatestopCharTester - to check if the end has been reached.BufferUnderflowExceptionBufferOverflowExceptionpublic void parse8bit(Appendable buffer, @NotNull StopCharsTester stopCharsTester) throws BufferUnderflowException, BufferOverflowException
buffer - to populatestopCharsTester - to check if the end has been reached.BufferUnderflowExceptionBufferOverflowExceptionpublic long parseLong()
throws BufferUnderflowException
BufferUnderflowExceptionpublic double parseDouble()
throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowExceptionpublic long parseLongDecimal()
throws BufferUnderflowException
The number of decimal places can be retrieved with lastDecimalPlaces()
BufferUnderflowExceptionpublic boolean skipTo(@NotNull
StopCharTester tester)
tester - to stop at@NotNull public BigDecimal parseBigDecimal()
Copyright © 2017. All rights reserved.