Class PackedInt32s
Simplistic compression for array of unsigned long values. Each value is >= 0 and <= a specified maximum value. The values are stored as packed ints, with each value consuming a fixed number of bits.
NOTE: This was PackedInts in Lucene.
@lucene.internal
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public class PackedInt32s : object
Fields
Name | Description |
---|---|
CODEC_NAME | |
COMPACT | No memory overhead at all, but the returned implementation may be slow. |
DEFAULT | At most 20% memory overhead. |
DEFAULT_BUFFER_SIZE | Default amount of memory to use for bulk operations. |
FAST | At most 50% memory overhead, always select a reasonably fast implementation. |
FASTEST | At most 700% memory overhead, always select a direct implementation. |
VERSION_BYTE_ALIGNED | |
VERSION_CURRENT | |
VERSION_START |
Methods
Name | Description |
---|---|
BitsRequired(Int64) | Returns how many bits are required to hold values up
to and including @lucene.internal |
CheckVersion(Int32) | Check the validity of a version number. |
Copy(PackedInt32s.Reader, Int32, PackedInt32s.Mutable, Int32, Int32, Int32) | Copy |
FastestFormatAndBits(Int32, Int32, Single) | Try to find the PackedInt32s.Format and number of bits per value that would
restore from disk the fastest reader whose overhead is less than
The
If you don't know how many values you are going to write, use
|
GetDecoder(PackedInt32s.Format, Int32, Int32) | Get a PackedInt32s.IDecoder. |
GetDirectReader(IndexInput) | Construct a direct PackedInt32s.Reader from an IndexInput. this method is useful to restore data from streams which have been created using GetWriter(DataOutput, Int32, Int32, Single). The returned reader will have very little memory overhead, but every call to Get(Int32) is likely to perform a disk seek. @lucene.internal |
GetDirectReaderNoHeader(IndexInput, PackedInt32s.Format, Int32, Int32, Int32) | Expert: Construct a direct PackedInt32s.Reader from a stream without reading metadata at the beginning of the stream. This method is useful to restore data from streams which have been created using GetWriterNoHeader(DataOutput, PackedInt32s.Format, Int32, Int32, Int32). The returned reader will have very little memory overhead, but every call to Get(Int32) is likely to perform a disk seek. @lucene.internal |
GetDirectReaderNoHeader(IndexInput, PackedInt32s.Header) | Expert: Construct a direct PackedInt32s.Reader from an IndexInput without reading metadata at the beginning of the stream. this method is useful to restore data when metadata has been previously read using ReadHeader(DataInput). @lucene.internal |
GetEncoder(PackedInt32s.Format, Int32, Int32) | Get an PackedInt32s.IEncoder. |
GetMutable(Int32, Int32, PackedInt32s.Format) | Same as GetMutable(Int32, Int32, Single) with a pre-computed number of bits per value and format. @lucene.internal |
GetMutable(Int32, Int32, Single) | Create a packed integer array with the given amount of values initialized
to 0. The
Positive values of @lucene.internal |
GetReader(DataInput) | Restore a PackedInt32s.Reader from a stream. @lucene.internal |
GetReaderIterator(DataInput, Int32) | Retrieve PackedInt32s as a PackedInt32s.IReaderIterator. @lucene.internal |
GetReaderIteratorNoHeader(DataInput, PackedInt32s.Format, Int32, Int32, Int32, Int32) | Expert: Restore a PackedInt32s.IReaderIterator from a stream without reading metadata at the beginning of the stream. This method is useful to restore data from streams which have been created using GetWriterNoHeader(DataOutput, PackedInt32s.Format, Int32, Int32, Int32). @lucene.internal |
GetReaderNoHeader(DataInput, PackedInt32s.Format, Int32, Int32, Int32) | Expert: Restore a PackedInt32s.Reader from a stream without reading metadata at the beginning of the stream. This method is useful to restore data from streams which have been created using GetWriterNoHeader(DataOutput, PackedInt32s.Format, Int32, Int32, Int32). @lucene.internal |
GetReaderNoHeader(DataInput, PackedInt32s.Header) | Expert: Restore a PackedInt32s.Reader from a stream without reading metadata at the beginning of the stream. this method is useful to restore data when metadata has been previously read using ReadHeader(DataInput). @lucene.internal |
GetWriter(DataOutput, Int32, Int32, Single) | 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 under the hoods, up to 63 bits will be wasted.
An easy way to make sure that no space is lost is to always use a
This method writes metadata to the stream, so that the resulting stream is
sufficient to restore a PackedInt32s.Reader from it. You don't need to track
The @lucene.internal |
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 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:
It is possible to start writing values without knowing how many of them you
are actually going to write. To do this, just pass
The @lucene.internal |
MaxValue(Int32) | Calculates the maximum unsigned long that can be expressed with the given number of bits. @lucene.internal |
ReadHeader(DataInput) | Expert: reads only the metadata from a stream. This is useful to later restore a stream or open a direct reader via GetReaderNoHeader(DataInput, PackedInt32s.Header) or GetDirectReaderNoHeader(IndexInput, PackedInt32s.Header). |