Package org.apache.lucene.index
Class ByteSliceWriter
java.lang.Object
org.apache.lucene.store.DataOutput
org.apache.lucene.index.ByteSliceWriter
Class to write byte streams into slices of shared
byte[]. This is used by DocumentsWriter to hold the
posting list for many terms in RAM.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int(package private) intprivate final ByteBlockPoolprivate byte[]private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidinit(int address) Set up the writer to write at address.voidwriteByte(byte b) Write byte into byte slice streamvoidwriteBytes(byte[] b, int offset, int len) Writes an array of bytes.Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
Field Details
-
BYTE_BLOCK_NOT_MASK
private static final int BYTE_BLOCK_NOT_MASK- See Also:
-
slice
private byte[] slice -
upto
private int upto -
pool
-
offset0
int offset0
-
-
Constructor Details
-
ByteSliceWriter
-
-
Method Details
-
init
public void init(int address) Set up the writer to write at address. -
writeByte
public void writeByte(byte b) Write byte into byte slice stream- 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:
-
getAddress
public int getAddress()
-