@Override public void writeAllTo(OutputStream out) throws IOException { BytesUtils.writeUnsignedVarInt(intValue, out); }
public static void writeZigZagVarInt(int intValue, OutputStream out) throws IOException{ writeUnsignedVarInt((intValue << 1) ^ (intValue >> 31), out); }
@Override public void writeAllTo(OutputStream out) throws IOException { BytesUtils.writeUnsignedVarInt(intValue, out); }
public static void writeZigZagVarInt(int intValue, OutputStream out) throws IOException{ writeUnsignedVarInt((intValue << 1) ^ (intValue >> 31), out); }
public ByteBuffer toByteBuffer() throws IOException { ByteBuffer ret = ByteBuffer.allocate((int) size()); BytesUtils.writeUnsignedVarInt(intValue, ret); return ret; }
public ByteBuffer toByteBuffer() throws IOException { ByteBuffer ret = ByteBuffer.allocate((int) size()); BytesUtils.writeUnsignedVarInt(intValue, ret); return ret; }
private void writeRleRun() throws IOException { // we may have been working on a bit-packed-run // so close that run if it exists before writing this // rle-run endPreviousBitPackedRun(); // write the rle-header (lsb of 0 signifies a rle run) BytesUtils.writeUnsignedVarInt(repeatCount << 1, baos); // write the repeated-value BytesUtils.writeIntLittleEndianPaddedOnBitWidth(baos, previousValue, bitWidth); // reset the repeat count repeatCount = 0; // throw away all the buffered values, they were just repeats and they've been written numBufferedValues = 0; }
private void writeRleRun() throws IOException { // we may have been working on a bit-packed-run // so close that run if it exists before writing this // rle-run endPreviousBitPackedRun(); // write the rle-header (lsb of 0 signifies a rle run) BytesUtils.writeUnsignedVarInt(repeatCount << 1, baos); // write the repeated-value BytesUtils.writeIntLittleEndianPaddedOnBitWidth(baos, previousValue, bitWidth); // reset the repeat count repeatCount = 0; // throw away all the buffered values, they were just repeats and they've been written numBufferedValues = 0; }