@Override public synchronized int decompress(byte[] b, int off, int len) throws IOException { try { return super.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage()); } } }
@Override public void close() throws IOException { if (writePointer > 0) { inflater.setInput(writeBuffer, 0, writePointer); try { int n = inflater.inflate(outputBuffer); while (n > 0) { output.write(outputBuffer, 0, n); n = inflater.inflate(outputBuffer); } output.close(); } catch (DataFormatException e) { IOException io = new IOException(e.getMessage()); io.initCause(e); throw io; } } }
@Override public int read() throws IOException { if (pointer == -1) { try { length = doRead(readBuffer, 0, readBuffer.length); if (length == 0) { return -1; } pointer = 0; } catch (DataFormatException e) { IOException e2 = new IOException(e.getMessage()); e2.initCause(e); throw e2; } } int value = readBuffer[pointer] & 0xFF; pointer++; if (pointer == length) { pointer = -1; } return value; }
private PooledByteBuffer decompress(WebSocketChannel channel, PooledByteBuffer pooled) throws IOException { ByteBuffer buffer = pooled.getBuffer(); while (!decompress.needsInput() && !decompress.finished()) { if (!buffer.hasRemaining()) { pooled = largerBuffer(pooled, channel, buffer.capacity() * 2); buffer = pooled.getBuffer(); } int n; try { n = decompress.inflate(buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining()); } catch (DataFormatException e) { WebSocketLogger.EXTENSION_LOGGER.debug(e.getMessage(), e); throw WebSocketMessages.MESSAGES.badCompressedPayload(e); } buffer.position(buffer.position() + n); } return pooled; }
numAvailBytes = inflater.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage());
read = inf.inflate(buffer, byteOffset, byteCount); } catch (DataFormatException e) { throw new ZipException(e.getMessage());
/** * Potentially reads more bytes to fill the inflater's buffer and * reads from it. */ private int readFromInflater(final byte[] buffer, final int offset, final int length) throws IOException { int read = 0; do { if (inf.needsInput()) { final int l = fill(); if (l > 0) { current.bytesReadFromStream += buf.limit(); } else if (l == -1) { return -1; } else { break; } } try { read = inf.inflate(buffer, offset, length); } catch (final DataFormatException e) { throw (IOException) new ZipException(e.getMessage()).initCause(e); } } while (read == 0 && inf.needsInput()); return read; }
resultInfo.append(new String(uncompressedBytes.getData())); } catch (DataFormatException e) { resultInfo.append("Error in some data. Reason : ").append(e.getMessage());
numDecompressedBytes = inflater.inflate(result, offset, result.length - offset); } catch (DataFormatException e) { String s = e.getMessage(); throw new ZipException(s != null ? s : "Invalid ZLIB data format");
@Override public int read(byte[] dst, int pos, int cnt) throws IOException { try { int n = 0; while (n < cnt) { int r = inf.inflate(dst, pos + n, cnt - n); n += r; if (inf.finished()) break; if (inf.needsInput()) { onObjectData(src, buf, p, bAvail); use(bAvail); p = fill(src, 1); inf.setInput(buf, p, bAvail); } else if (r == 0) { throw new CorruptObjectException(MessageFormat.format( JGitText.get().packfileCorruptionDetected, JGitText.get().unknownZlibError)); } } actualSize += n; return 0 < n ? n : -1; } catch (DataFormatException dfe) { throw new CorruptObjectException(MessageFormat.format(JGitText .get().packfileCorruptionDetected, dfe.getMessage())); } }
public synchronized int decompress(byte[] b, int off, int len) throws IOException { try { return super.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage()); } } }
@Override public synchronized int decompress(byte[] b, int off, int len) throws IOException { try { return super.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage()); } } }
@Override public synchronized int decompress(byte[] b, int off, int len) throws IOException { try { return super.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage()); } } }
@Override public synchronized int decompress(byte[] b, int off, int len) throws IOException { try { return super.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage()); } } }
public synchronized int decompress(byte[] b, int off, int len) throws IOException { try { return super.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage()); } } }
@Override public synchronized int decompress(byte[] b, int off, int len) throws IOException { try { return super.inflate(b, off, len); } catch (DataFormatException dfe) { throw new IOException(dfe.getMessage()); } } }
private int inflate(byte[] bytes) throws ZipException { try { return inflater.inflate(bytes); } catch (DataFormatException x) { throw new ZipException(x.getMessage()); } }
private int inflate(byte[] bytes) throws ZipException { try { return inflater.inflate(bytes); } catch (DataFormatException x) { throw new ZipException(x.getMessage()); } }
@Override public void deserializeAttribute(byte[] data, CloudioAttribute.InternalAttribute attribute) throws CloudioAttributeConstraintException, NumberFormatException, IOException { try { super.deserializeAttribute(decompress(Arrays.copyOfRange(data, 1, data.length)), attribute); } catch (DataFormatException exception) { log.error("Exception: " + exception.getMessage()); exception.printStackTrace(); } }
private void decompress(ArrayByteList src) throws BinaryParsingException { if (nodeTokens == null) nodeTokens = new ArrayByteList(); nodeTokens.clear(); try { nodeTokens.add(decompressor, src); } catch (DataFormatException e) { String s = e.getMessage(); throw new BinaryParsingException( s != null ? s : "Invalid ZLIB data format", e); } src.swap(nodeTokens); // replace src with nodeTokens nodeTokens.clear(); }