private void readByte() throws IOException { checkState(bitsInData == 0); data = byteStream.next(); bitsInData = 8; }
if (presentStream.nextBit()) { verify(dataStream != null); type.writeLong(builder, dataStream.next());
@Override protected Byte readValue(ByteInputStream valueStream) throws IOException { return valueStream.next(); } }
if (presentStream.nextBit()) { verify(dataStream != null); type.writeLong(builder, dataStream.next());
public void nextVector(Type type, long items, BlockBuilder builder) throws IOException { for (int i = 0; i < items; i++) { type.writeLong(builder, next()); } } }
public int countBitsSet(int items) throws IOException { int count = 0; // count buffered data if (items > bitsInData && bitsInData > 0) { count += bitCount(data); items -= bitsInData; bitsInData = 0; } // count whole bytes while (items > 8) { count += bitCount(byteStream.next()); items -= 8; } // count remaining bits for (int i = 0; i < items; i++) { count += nextBit() ? 1 : 0; } return count; }
private void readByte() throws IOException { checkState(bitsInData == 0); data = byteStream.next(); bitsInData = 8; }
@Override protected Byte readValue(ByteInputStream valueStream) throws IOException { return valueStream.next(); } }
public void nextVector(Type type, long items, BlockBuilder builder) throws IOException { for (int i = 0; i < items; i++) { type.writeLong(builder, next()); } } }
public int countBitsSet(int items) throws IOException { int count = 0; // count buffered data if (items > bitsInData && bitsInData > 0) { count += bitCount(data); items -= bitsInData; bitsInData = 0; } // count whole bytes while (items > 8) { count += bitCount(byteStream.next()); items -= 8; } // count remaining bits for (int i = 0; i < items; i++) { count += nextBit() ? 1 : 0; } return count; }