Method GetWriterNoHeader
GetWriterNoHeader(DataOutput, PackedInt32s.Format, Int32, Int32, Int32)
Expert: Create a packed integer array writer for the given output, format, value count, and number of bits per value.
The resulting stream will be long-aligned. this means that depending on
the format which is used, up to 63 bits will be wasted. An easy way to
make sure that no space is lost is to always use a valueCount
that is a multiple of 64.
This method does not write any metadata to the stream, meaning that it is your responsibility to store it somewhere else in order to be able to recover data from the stream later on:
format
(using Id),valueCount
,bitsPerValue
,- VERSION_CURRENT.
It is possible to start writing values without knowing how many of them you
are actually going to write. To do this, just pass -1
as
valueCount
. On the other hand, for any positive value of
valueCount
, the returned writer will make sure that you don't
write more values than expected and pad the end of stream with zeros in
case you have written less than valueCount
when calling
Finish().
The mem
parameter lets you control how much memory can be used
to buffer changes in memory before flushing to disk. High values of
mem
are likely to improve throughput. On the other hand, if
speed is not that important to you, a value of 0
will use as
little memory as possible and should already offer reasonable throughput.
@lucene.internal
Declaration
public static PackedInt32s.Writer GetWriterNoHeader(DataOutput out, PackedInt32s.Format format, int valueCount, int bitsPerValue, int mem)
Parameters
Type | Name | Description |
---|---|---|
DataOutput | out | The data output. |
PackedInt32s.Format | format | The format to use to serialize the values. |
System.Int32 | valueCount | The number of values. |
System.Int32 | bitsPerValue | The number of bits per value. |
System.Int32 | mem | How much memory (in bytes) can be used to speed up serialization. |
Returns
Type | Description |
---|---|
PackedInt32s.Writer |