/** * Sets the preset dictionary to be used for inflation to {@code dictionary}. * See {@link #needsDictionary} for details. */ public synchronized void setDictionary(byte[] dictionary) { setDictionary(dictionary, 0, dictionary.length); }
@Override public synchronized void setDictionary(byte[] b, int off, int len) { inflater.setDictionary(b, off, len); }
"decompression failure, unable to set dictionary as non was specified"); inflater.setDictionary(dictionary);
private int decompress(ByteBufAllocator alloc, SpdyHeadersFrame frame) throws Exception { ensureBuffer(alloc); byte[] out = decompressed.array(); int off = decompressed.arrayOffset() + decompressed.writerIndex(); try { int numBytes = decompressor.inflate(out, off, decompressed.writableBytes()); if (numBytes == 0 && decompressor.needsDictionary()) { try { decompressor.setDictionary(SPDY_DICT); } catch (IllegalArgumentException ignored) { throw INVALID_HEADER_BLOCK; } numBytes = decompressor.inflate(out, off, decompressed.writableBytes()); } if (frame != null) { decompressed.writerIndex(decompressed.writerIndex() + numBytes); decodeHeaderBlock(decompressed, frame); decompressed.discardReadBytes(); } return numBytes; } catch (DataFormatException e) { throw new SpdyProtocolException("Received invalid header block", e); } }
"decompression failure, unable to set dictionary as non was specified"); inflater.setDictionary(dictionary);
"decompression failure, unable to set dictionary as non was specified"); inflater.setDictionary(dictionary);
private int decompress(SpdyHeadersFrame frame) throws Exception { ensureBuffer(); byte[] out = decompressed.array(); int off = decompressed.arrayOffset() + decompressed.writerIndex(); try { int numBytes = decompressor.inflate(out, off, decompressed.writableBytes()); if (numBytes == 0 && decompressor.needsDictionary()) { try { decompressor.setDictionary(SPDY_DICT); } catch (IllegalArgumentException e) { throw INVALID_HEADER_BLOCK; } numBytes = decompressor.inflate(out, off, decompressed.writableBytes()); } decompressed.writerIndex(decompressed.writerIndex() + numBytes); super.decodeHeaderBlock(decompressed, frame); decompressed.discardReadBytes(); return numBytes; } catch (DataFormatException e) { throw INVALID_HEADER_BLOCK; } }
/** * Sets the preset dictionary to be used for inflation to {@code dictionary}. * See {@link #needsDictionary} for details. */ public synchronized void setDictionary(byte[] dictionary) { setDictionary(dictionary, 0, dictionary.length); }
/** * Sets the preset dictionary to be used for inflation to {@code dictionary}. * See {@link #needsDictionary} for details. */ public synchronized void setDictionary(byte[] dictionary) { setDictionary(dictionary, 0, dictionary.length); }
/** * Sets the preset dictionary to be used for inflation to {@code dictionary}. * See {@link #needsDictionary} for details. */ public synchronized void setDictionary(byte[] dictionary) { setDictionary(dictionary, 0, dictionary.length); }
/** * Sets the preset dictionary to be used for inflation to {@code dictionary}. * See {@link #needsDictionary} for details. */ public synchronized void setDictionary(byte[] dictionary) { setDictionary(dictionary, 0, dictionary.length); }
@Override public void setDictionary(byte[] dictionary) { inflater.setDictionary(dictionary); }
/** * Sets the preset dictionary to be used for inflation to {@code dictionary}. * See {@link #needsDictionary} for details. */ public synchronized void setDictionary(byte[] dictionary) { setDictionary(dictionary, 0, dictionary.length); }
/** * Sets the preset dictionary to be used for inflation to {@code dictionary}. * See {@link #needsDictionary} for details. */ public synchronized void setDictionary(byte[] dictionary) { setDictionary(dictionary, 0, dictionary.length); }
@Override public synchronized void setDictionary(byte[] b, int off, int len) { inflater.setDictionary(b, off, len); }
@Override public synchronized void setDictionary(byte[] b, int off, int len) { inflater.setDictionary(b, off, len); }
@Override public synchronized void setDictionary(byte[] b, int off, int len) { inflater.setDictionary(b, off, len); }
@Override public synchronized void setDictionary(byte[] b, int off, int len) { inflater.setDictionary(b, off, len); }
@Override protected Inflater initialValue() { final Inflater inf = new Inflater(false); if (dictionary.length > 0) { inf.setDictionary(dictionary); } return inf; } };
public InputStream createDecompressingInputStream(final InputStream compressed) throws IOException { Args.notNull("compressed", compressed); final Inflater decompressor = new Inflater(false); if (dictionary.length > 0) { decompressor.setDictionary(dictionary); } return new InflaterInputStream(compressed, decompressor); }