java.lang.Object
org.apache.lucene.store.DataOutput
org.apache.lucene.util.fst.BytesStore
- All Implemented Interfaces:
Accountable,FSTReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate final intprivate final intprivate final List<byte[]> private final intprivate byte[]private intFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyBytes(long src, long dest, int len) Absolute copy bytes self to self, without changing the position.voidCopy numBytes bytes from input to ourself.voidfinish()(package private) intlongGet the reverse BytesReader for this FSTlongReturn the memory usage of this object in bytes.voidreverse(long srcPos, long destPos) Reverse from srcPos, inclusive, to destPos, inclusive.voidsetPosition(long newLen) Set the position of this BytesStore, truncating or expanding if neededprivate voidskipBytes(int len) toString()voidwriteByte(byte b) Writes a single byte.voidwriteBytes(byte[] b, int offset, int len) Writes an array of bytes.(package private) voidwriteBytes(long dest, byte[] b, int offset, int len) Absolute writeBytes without changing the current position.voidwriteTo(long src, byte[] dest, int offset, int len) Copies bytes from this store to a target byte array.voidwriteTo(DataOutput out) Writes all of our bytes to the targetDataOutput.Methods inherited from class org.apache.lucene.store.DataOutput
writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLongMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED -
blocks
-
blockSize
private final int blockSize -
blockBits
private final int blockBits -
blockMask
private final int blockMask -
current
private byte[] current -
nextWrite
private int nextWrite
-
-
Constructor Details
-
BytesStore
public BytesStore(int blockBits)
-
-
Method Details
-
writeByte
public void writeByte(byte b) Description copied from class:DataOutputWrites a single byte.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.
- Specified by:
writeBytein classDataOutput- See Also:
-
writeBytes
public void writeBytes(byte[] b, int offset, int len) Description copied from class:DataOutputWrites an array of bytes.- Specified by:
writeBytesin classDataOutput- Parameters:
b- the bytes to writeoffset- the offset in the byte arraylen- the number of bytes to write- See Also:
-
getBlockBits
int getBlockBits() -
writeBytes
void writeBytes(long dest, byte[] b, int offset, int len) Absolute writeBytes without changing the current position. Note: this cannot "grow" the bytes, so you must only call it on already written parts. -
copyBytes
Description copied from class:DataOutputCopy numBytes bytes from input to ourself.- Overrides:
copyBytesin classDataOutput- Throws:
IOException
-
copyBytes
public void copyBytes(long src, long dest, int len) Absolute copy bytes self to self, without changing the position. Note: this cannot "grow" the bytes, so must only call it on already written parts. -
writeTo
public void writeTo(long src, byte[] dest, int offset, int len) Copies bytes from this store to a target byte array. -
reverse
public void reverse(long srcPos, long destPos) Reverse from srcPos, inclusive, to destPos, inclusive. -
skipBytes
private void skipBytes(int len) -
getPosition
public long getPosition() -
setPosition
public void setPosition(long newLen) Set the position of this BytesStore, truncating or expanding if needed -
finish
public void finish() -
writeTo
Writes all of our bytes to the targetDataOutput.- Specified by:
writeToin interfaceFSTReader- Parameters:
out- the DataOutput- Throws:
IOException- if exception occurred during writing
-
getForwardReader
-
getReverseBytesReader
Description copied from interface:FSTReaderGet the reverse BytesReader for this FST- Specified by:
getReverseBytesReaderin interfaceFSTReader- Returns:
- the reverse BytesReader
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
toString
-