/** * Reads the encoded binary trees and prepares the bit stream. * * @throws IOException */ private void init() throws IOException { if (bits == null) { try (CountingInputStream i = new CountingInputStream(in) { @Override public void close() { // we do not want to close in } }) { if (numberOfTrees == 3) { literalTree = BinaryTree.decode(i, 256); } lengthTree = BinaryTree.decode(i, 64); distanceTree = BinaryTree.decode(i, 64); treeSizes += i.getBytesRead(); } bits = new BitStream(in); } }
/** * Reads the encoded binary trees and prepares the bit stream. * * @throws IOException */ private void init() throws IOException { if (bits == null) { if (numberOfTrees == 3) { literalTree = BinaryTree.decode(in, 256); } lengthTree = BinaryTree.decode(in, 64); distanceTree = BinaryTree.decode(in, 64); bits = new BitStream(in); } }