class BytesStore extends DataOutput implements Accountable
Modifier and Type | Field and Description |
---|---|
private static long |
BASE_RAM_BYTES_USED |
private int |
blockBits |
private int |
blockMask |
private java.util.List<byte[]> |
blocks |
private int |
blockSize |
private byte[] |
current |
private int |
nextWrite |
Constructor and Description |
---|
BytesStore(DataInput in,
long numBytes,
int maxBlockSize)
Pulls bytes from the provided IndexInput.
|
BytesStore(int blockBits) |
Modifier and Type | Method and Description |
---|---|
void |
copyBytes(long src,
long dest,
int len)
Absolute copy bytes self to self, without changing the
position.
|
void |
finish() |
(package private) int |
getBlockBits() |
FST.BytesReader |
getForwardReader() |
long |
getPosition() |
FST.BytesReader |
getReverseReader() |
(package private) FST.BytesReader |
getReverseReader(boolean allowSingle) |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
void |
reverse(long srcPos,
long destPos)
Reverse from srcPos, inclusive, to destPos, inclusive.
|
void |
skipBytes(int len) |
java.lang.String |
toString() |
void |
truncate(long newLen)
Pos must be less than the max position written so far!
Ie, you cannot "grow" the file with this!
|
void |
writeByte(byte b)
Writes a single byte.
|
void |
writeByte(int dest,
byte b)
Absolute write byte; you must ensure dest is < max
position written so far.
|
void |
writeBytes(byte[] b,
int offset,
int len)
Writes an array of bytes.
|
(package private) void |
writeBytes(long dest,
byte[] b,
int offset,
int len)
Absolute writeBytes without changing the current
position.
|
void |
writeInt(long pos,
int value)
Writes an int at the absolute position without
changing the current pointer.
|
void |
writeTo(DataOutput out)
Writes all of our bytes to the target
DataOutput . |
copyBytes, writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildResources
private static final long BASE_RAM_BYTES_USED
private final java.util.List<byte[]> blocks
private final int blockSize
private final int blockBits
private final int blockMask
private byte[] current
private int nextWrite
public BytesStore(int blockBits)
public BytesStore(DataInput in, long numBytes, int maxBlockSize) throws java.io.IOException
java.io.IOException
public void writeByte(int dest, byte b)
public void writeByte(byte b)
DataOutput
The most primitive data type is an eight-bit byte. Files are accessed as sequences of bytes. All other data types are defined as sequences of bytes, so file formats are byte-order independent.
writeByte
in class DataOutput
DataInput.readByte()
public void writeBytes(byte[] b, int offset, int len)
DataOutput
writeBytes
in class DataOutput
b
- the bytes to writeoffset
- the offset in the byte arraylen
- the number of bytes to writeDataInput.readBytes(byte[],int,int)
int getBlockBits()
void writeBytes(long dest, byte[] b, int offset, int len)
public void copyBytes(long src, long dest, int len)
public void writeInt(long pos, int value)
public void reverse(long srcPos, long destPos)
public void skipBytes(int len)
public long getPosition()
public void truncate(long newLen)
public void finish()
public void writeTo(DataOutput out) throws java.io.IOException
DataOutput
.java.io.IOException
public FST.BytesReader getForwardReader()
public FST.BytesReader getReverseReader()
FST.BytesReader getReverseReader(boolean allowSingle)
public long ramBytesUsed()
Accountable
ramBytesUsed
in interface Accountable
public java.lang.String toString()
toString
in class java.lang.Object