/** * Write the Huffman symbol to output byte map. */ private void writeSymbolMap(ByteBuf out) { Bzip2BitWriter writer = this.writer; final boolean[] blockValuesPresent = this.blockValuesPresent; final boolean[] condensedInUse = new boolean[16]; for (int i = 0; i < condensedInUse.length; i++) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { if (blockValuesPresent[k]) { condensedInUse[i] = true; } } } for (boolean isCondensedInUse : condensedInUse) { writer.writeBoolean(out, isCondensedInUse); } for (int i = 0; i < condensedInUse.length; i++) { if (condensedInUse[i]) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { writer.writeBoolean(out, blockValuesPresent[k]); } } } }
/** * Writes a zero-terminated unary number to the output {@link ByteBuf}. * Example of the output for value = 6: {@code 1111110} * @param value The number of {@code 1} to write */ void writeUnary(ByteBuf out, int value) { if (value < 0) { throw new IllegalArgumentException("value: " + value + " (expected 0 or more)"); } while (value-- > 0) { writeBoolean(out, true); } writeBoolean(out, false); }
/** * Writes a zero-terminated unary number to the output {@link ByteBuf}. * Example of the output for value = 6: {@code 1111110} * @param value The number of {@code 1} to write */ void writeUnary(ByteBuf out, int value) { if (value < 0) { throw new IllegalArgumentException("value: " + value + " (expected 0 or more)"); } while (value-- > 0) { writeBoolean(out, true); } writeBoolean(out, false); }
/** * Write the Huffman symbol to output byte map. */ private void writeSymbolMap(ByteBuf out) { Bzip2BitWriter writer = this.writer; final boolean[] blockValuesPresent = this.blockValuesPresent; final boolean[] condensedInUse = new boolean[16]; for (int i = 0; i < condensedInUse.length; i++) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { if (blockValuesPresent[k]) { condensedInUse[i] = true; } } } for (boolean isCondensedInUse : condensedInUse) { writer.writeBoolean(out, isCondensedInUse); } for (int i = 0; i < condensedInUse.length; i++) { if (condensedInUse[i]) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { writer.writeBoolean(out, blockValuesPresent[k]); } } } }
/** * Write the Huffman symbol to output byte map. */ private void writeSymbolMap(ByteBuf out) { Bzip2BitWriter writer = this.writer; final boolean[] blockValuesPresent = this.blockValuesPresent; final boolean[] condensedInUse = new boolean[16]; for (int i = 0; i < condensedInUse.length; i++) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { if (blockValuesPresent[k]) { condensedInUse[i] = true; } } } for (boolean isCondensedInUse : condensedInUse) { writer.writeBoolean(out, isCondensedInUse); } for (int i = 0; i < condensedInUse.length; i++) { if (condensedInUse[i]) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { writer.writeBoolean(out, blockValuesPresent[k]); } } } }
/** * Writes a zero-terminated unary number to the output {@link ByteBuf}. * Example of the output for value = 6: {@code 1111110} * @param value The number of {@code 1} to write */ void writeUnary(ByteBuf out, int value) { if (value < 0) { throw new IllegalArgumentException("value: " + value + " (expected 0 or more)"); } while (value-- > 0) { writeBoolean(out, true); } writeBoolean(out, false); }
writer.writeBits(out, 2, value); writer.writeBoolean(out, false); currentLength = codeLength;
writer.writeBits(out, 2, value); writer.writeBoolean(out, false); currentLength = codeLength;
writer.writeBits(out, 2, value); writer.writeBoolean(out, false); currentLength = codeLength;
writer.writeBits(out, 24, BLOCK_HEADER_MAGIC_2); writer.writeInt(out, crc.getCRC()); writer.writeBoolean(out, false); // Randomised block flag. We never create randomised blocks writer.writeBits(out, 24, bwtStartPointer);
writer.writeBits(out, 24, BLOCK_HEADER_MAGIC_2); writer.writeInt(out, crc.getCRC()); writer.writeBoolean(out, false); // Randomised block flag. We never create randomised blocks writer.writeBits(out, 24, bwtStartPointer);
writer.writeBits(out, 24, BLOCK_HEADER_MAGIC_2); writer.writeInt(out, crc.getCRC()); writer.writeBoolean(out, false); // Randomised block flag. We never create randomised blocks writer.writeBits(out, 24, bwtStartPointer);
/** * Writes a zero-terminated unary number to the output {@link ByteBuf}. * Example of the output for value = 6: {@code 1111110} * @param value The number of {@code 1} to write */ void writeUnary(ByteBuf out, int value) { if (value < 0) { throw new IllegalArgumentException("value: " + value + " (expected 0 or more)"); } while (value-- > 0) { writeBoolean(out, true); } writeBoolean(out, false); }
/** * Writes a zero-terminated unary number to the output {@link ByteBuf}. * Example of the output for value = 6: {@code 1111110} * @param value The number of {@code 1} to write */ void writeUnary(ByteBuf out, int value) { if (value < 0) { throw new IllegalArgumentException("value: " + value + " (expected 0 or more)"); } while (value-- > 0) { writeBoolean(out, true); } writeBoolean(out, false); }
/** * Writes a zero-terminated unary number to the output {@link ByteBuf}. * Example of the output for value = 6: {@code 1111110} * @param value The number of {@code 1} to write */ void writeUnary(ByteBuf out, int value) { if (value < 0) { throw new IllegalArgumentException("value: " + value + " (expected 0 or more)"); } while (value-- > 0) { writeBoolean(out, true); } writeBoolean(out, false); }
/** * Write the Huffman symbol to output byte map. */ private void writeSymbolMap(ByteBuf out) { Bzip2BitWriter writer = this.writer; final boolean[] blockValuesPresent = this.blockValuesPresent; final boolean[] condensedInUse = new boolean[16]; for (int i = 0; i < condensedInUse.length; i++) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { if (blockValuesPresent[k]) { condensedInUse[i] = true; } } } for (boolean isCondensedInUse : condensedInUse) { writer.writeBoolean(out, isCondensedInUse); } for (int i = 0; i < condensedInUse.length; i++) { if (condensedInUse[i]) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { writer.writeBoolean(out, blockValuesPresent[k]); } } } }
/** * Write the Huffman symbol to output byte map. */ private void writeSymbolMap(ByteBuf out) { Bzip2BitWriter writer = this.writer; final boolean[] blockValuesPresent = this.blockValuesPresent; final boolean[] condensedInUse = new boolean[16]; for (int i = 0; i < condensedInUse.length; i++) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { if (blockValuesPresent[k]) { condensedInUse[i] = true; } } } for (boolean isCondensedInUse : condensedInUse) { writer.writeBoolean(out, isCondensedInUse); } for (int i = 0; i < condensedInUse.length; i++) { if (condensedInUse[i]) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { writer.writeBoolean(out, blockValuesPresent[k]); } } } }
/** * Writes a zero-terminated unary number to the output {@link ByteBuf}. * Example of the output for value = 6: {@code 1111110} * @param value The number of {@code 1} to write */ void writeUnary(ByteBuf out, int value) { if (value < 0) { throw new IllegalArgumentException("value: " + value + " (expected 0 or more)"); } while (value-- > 0) { writeBoolean(out, true); } writeBoolean(out, false); }
/** * Write the Huffman symbol to output byte map. */ private void writeSymbolMap(ByteBuf out) { Bzip2BitWriter writer = this.writer; final boolean[] blockValuesPresent = this.blockValuesPresent; final boolean[] condensedInUse = new boolean[16]; for (int i = 0; i < condensedInUse.length; i++) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { if (blockValuesPresent[k]) { condensedInUse[i] = true; } } } for (boolean isCondensedInUse : condensedInUse) { writer.writeBoolean(out, isCondensedInUse); } for (int i = 0; i < condensedInUse.length; i++) { if (condensedInUse[i]) { for (int j = 0, k = i << 4; j < HUFFMAN_SYMBOL_RANGE_SIZE; j++, k++) { writer.writeBoolean(out, blockValuesPresent[k]); } } } }
writer.writeBits(out, 2, value); writer.writeBoolean(out, false); currentLength = codeLength;