Package org.apache.lucene.index
Class ByteSliceWriter
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.index.ByteSliceWriter
-
final class ByteSliceWriter extends DataOutput
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
Fields Modifier and Type Field Description private static intBYTE_BLOCK_NOT_MASK(package private) intoffset0private ByteBlockPoolpoolprivate byte[]sliceprivate intupto
-
Constructor Summary
Constructors Constructor Description ByteSliceWriter(ByteBlockPool pool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAddress()voidinit(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 Detail
-
BYTE_BLOCK_NOT_MASK
private static final int BYTE_BLOCK_NOT_MASK
- See Also:
- Constant Field Values
-
slice
private byte[] slice
-
upto
private int upto
-
pool
private final ByteBlockPool pool
-
offset0
int offset0
-
-
Constructor Detail
-
ByteSliceWriter
public ByteSliceWriter(ByteBlockPool pool)
-
-
Method Detail
-
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:
DataInput.readByte()
-
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:
DataInput.readBytes(byte[],int,int)
-
getAddress
public int getAddress()
-
-