protected internal override void readMatrixFromInputStream(int rows, int columns, ExtendedDataInput @in) { int size = rows * columns; values = new long[size]; for (int i = 0; i < size; ++i) { values[i] = @in.readLong(); } }
public override void deserialize(int start, int count, ExtendedDataInput @in) { if (start + count > values.Count) { values.AddRange(new long[start + count - values.Count]); } for (int i = 0; i < count; ++i) { values[start + i] = @in.readLong(); } }
protected internal BasicLongVector(DATA_FORM df, ExtendedDataInput @in) : base(df) { int rows = @in.readInt(); int cols = @in.readInt(); int size = rows * cols; values = new long[size]; for (int i = 0; i < size; ++i) { values[i] = @in.readLong(); } }
public override ExtendedDataInput Decompress(ExtendedDataInput input, int length, int unitLength, int elementCount, int extra, bool isLittleEndian) { int offset = 8; ByteBuffer dest = CreateColumnVector(elementCount, extra, unitLength, isLittleEndian, 0); byte[] output = dest.array(); int outLength = output.Length - offset; int count = 0; DeltaOfDeltaBlockDecoder blockDecoder = new DeltaOfDeltaBlockDecoder(unitLength); while (length > 0 && count < outLength) { int blockSize = input.readInt(); if (blockSize < 0) { blockSize = blockSize & 2147483647; } length -= sizeof(int); blockSize = Math.Min(blockSize, length); if (blockSize == 0) { break; } long[] src = new long[blockSize / sizeof(long)]; for (int i = 0; i < src.Length; i++) { src[i] = input.readLong(); } count += blockDecoder.decompress(src, dest) * unitLength; length -= blockSize; } if (isLittleEndian) { return(new LittleEndianDataInputStream(new MemoryStream(output, 0, offset + count))); } return (new BigEndianDataInputStream(new MemoryStream(output, 0, offset + count))); }
public BasicLong(ExtendedDataInput @in) { value = @in.readLong(); }