@Override public synchronized boolean needsDictionary() { return inflater.needsDictionary(); }
/** * Implementation of read for DEFLATED entries. */ private int readDeflated(final byte[] buffer, final int offset, final int length) throws IOException { final int read = readFromInflater(buffer, offset, length); if (read <= 0) { if (inf.finished()) { return -1; } else if (inf.needsDictionary()) { throw new ZipException("This archive needs a preset dictionary" + " which is not supported by Commons" + " Compress."); } else if (read == -1) { throw new IOException("Truncated ZIP file"); } } return read; }
return bytesInflated; if (inflater.finished() || inflater.needsDictionary()) { releaseInflatedBytes(); if (tail.pos == tail.limit) {
return res; if (inflater.needsDictionary()) { throw msg.inflaterNeedsDictionary(); return res; if (inflater.needsDictionary()) { throw msg.inflaterNeedsDictionary();
return true; if (inflater.needsDictionary() || inflater.needsInput()) { return false;
} else if (eof) { return -1; } else if (inf.needsDictionary()) { eof = true; return -1;
if (inflater.needsDictionary()) { if (dictionary == null) { throw new DecompressionException(
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); } }
if (inflater.needsDictionary()) { if (dictionary == null) { throw new DecompressionException(
+ ", needsDict=" + decompressor.needsDictionary(), in);
if (inflater.needsDictionary()) { if (dictionary == null) { throw new DecompressionException(
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; } }
continue; if (inflater.finished() || inflater.needsDictionary() || in.available() == 0)
if ( inflater.finished() || inflater.needsDictionary() )
@Override public synchronized boolean needsDictionary() { return inflater.needsDictionary(); }
@Override public boolean needsDictionary() { return inflater.needsDictionary(); }
@Override public synchronized boolean needsDictionary() { return inflater.needsDictionary(); }
@Override public synchronized boolean needsDictionary() { return inflater.needsDictionary(); }
@Override public synchronized boolean needsDictionary() { return inflater.needsDictionary(); }
/** * Implementation of read for DEFLATED entries. */ private int readDeflated(final byte[] buffer, final int offset, final int length) throws IOException { final int read = readFromInflater(buffer, offset, length); if (read <= 0) { if (inf.finished()) { return -1; } else if (inf.needsDictionary()) { throw new ZipException("This archive needs a preset dictionary" + " which is not supported by Commons" + " Compress."); } else if (read == -1) { throw new IOException("Truncated ZIP file"); } } return read; }