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 (package private) int
offset0
private ByteBlockPool
pool
private byte[]
slice
private int
upto
-
Constructor Summary
Constructors Constructor Description ByteSliceWriter(ByteBlockPool pool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAddress()
void
init(int address)
Set up the writer to write at address.void
writeByte(byte b)
Write byte into byte slice streamvoid
writeBytes(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
-
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:
writeByte
in classDataOutput
- See Also:
DataInput.readByte()
-
writeBytes
public void writeBytes(byte[] b, int offset, int len)
Description copied from class:DataOutput
Writes an array of bytes.- Specified by:
writeBytes
in 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()
-
-