コード例 #1
0
        private int Iterations(int mem)
        {
            int iterations = bulkOperation.ComputeIterations(m_valueCount, mem);

            if (packedIntsVersion < PackedInt32s.VERSION_BYTE_ALIGNED)
            {
                // make sure iterations is a multiple of 8
                iterations = (iterations + 7) & unchecked ((int)0xFFFFFFF8);
            }
            return(iterations);
        }
コード例 #2
0
 internal PackedWriter(PackedInt32s.Format format, DataOutput @out, int valueCount, int bitsPerValue, int mem)
     : base(@out, valueCount, bitsPerValue)
 {
     this.format = format;
     encoder     = BulkOperation.Of(format, bitsPerValue);
     iterations  = encoder.ComputeIterations(valueCount, mem);
     nextBlocks  = new byte[iterations * encoder.ByteBlockCount];
     nextValues  = new long[iterations * encoder.ByteValueCount];
     off         = 0;
     written     = 0;
     finished    = false;
 }