in src/main/java/com/twitter/whiskey/util/ZlibInflater.java [91:121]
private ZlibInflater(Wrapper wrapper, byte[] dictionary) {
if (wrapper == null) {
throw new NullPointerException("wrapper");
}
switch (wrapper) {
case GZIP:
inflater = new Inflater(true);
crc = new CRC32();
accumulator = ByteBuffer.allocate(10);
accumulator.flip();
break;
case NONE:
inflater = new Inflater(true);
crc = null;
break;
case ZLIB:
inflater = new Inflater();
crc = null;
break;
case UNKNOWN:
// Postpone the decision until setInput(...) is called.
determineWrapper = true;
accumulator = ByteBuffer.allocate(10);
accumulator.flip();
crc = null;
break;
default:
throw new IllegalArgumentException("Only GZIP or ZLIB is supported, but you used " + wrapper);
}
this.dictionary = dictionary;
}