@Override protected int getCompressedData() throws IOException { checkStream(); // Get the size of the compressed chunk (always non-negative) int len = rawReadInt(); // Read len bytes from underlying stream if (len > buffer.length) { buffer = new byte[len]; } int n = 0, off = 0; while (n < len) { int count = in.read(buffer, off + n, len - n); if (count < 0) { throw new EOFException("Unexpected end of block in input stream"); } n += count; } return len; }
originalBlockSize = rawReadInt(); } catch (IOException ioe) { return -1;
@Override protected int getCompressedData() throws IOException { checkStream(); // Get the size of the compressed chunk (always non-negative) int len = rawReadInt(); // Read len bytes from underlying stream if (len > buffer.length) { buffer = new byte[len]; } int n = 0, off = 0; while (n < len) { int count = in.read(buffer, off + n, len - n); if (count < 0) { throw new EOFException("Unexpected end of block in input stream"); } n += count; } return len; }
@Override protected int getCompressedData() throws IOException { checkStream(); // Get the size of the compressed chunk (always non-negative) int len = rawReadInt(); // Read len bytes from underlying stream if (len > buffer.length) { buffer = new byte[len]; } int n = 0, off = 0; while (n < len) { int count = in.read(buffer, off + n, len - n); if (count < 0) { throw new EOFException("Unexpected end of block in input stream"); } n += count; } return len; }
@Override protected int getCompressedData() throws IOException { checkStream(); // Get the size of the compressed chunk (always non-negative) int len = rawReadInt(); // Read len bytes from underlying stream if (len > buffer.length) { buffer = new byte[len]; } int n = 0, off = 0; while (n < len) { int count = in.read(buffer, off + n, len - n); if (count < 0) { throw new EOFException("Unexpected end of block in input stream"); } n += count; } return len; }
@Override protected int getCompressedData() throws IOException { checkStream(); // Get the size of the compressed chunk (always non-negative) int len = rawReadInt(); // Read len bytes from underlying stream if (len > buffer.length) { buffer = new byte[len]; } int n = 0, off = 0; while (n < len) { int count = in.read(buffer, off + n, len - n); if (count < 0) { throw new EOFException("Unexpected end of block in input stream"); } n += count; } return len; }
void getCompressedData() throws IOException { checkStream(); // Get the size of the compressed chunk int len = rawReadInt(); // Read len bytes from underlying stream if (len > buffer.length) { buffer = new byte[len]; } int n = 0, off = 0; while (n < len) { int count = in.read(buffer, off + n, len - n); if (count < 0) { throw new EOFException(); } n += count; } // Send the read data to the decompressor decompressor.setInput(buffer, 0, len); }
protected void getCompressedData() throws IOException { checkStream(); // Get the size of the compressed chunk int len = rawReadInt(); checkLength(len); // Read len bytes from underlying stream if (len > buffer.length) { buffer = new byte[len]; } int n = 0, off = 0; while (n < len) { int count = in.read(buffer, off + n, len - n); if (count < 0) { throw new CodecPrematureEOFException( "Unexpected end of input stream, this is typically because of" + " truncated compressed file."); } n += count; } // Send the read data to the decompressor decompressor.setInput(buffer, 0, len); }
int decompress(byte[] b, int off, int len) throws IOException { // Check if we are the beginning of a block if (noUncompressedBytes == originalBlockSize) { // Get original data size try { originalBlockSize = rawReadInt(); } catch (IOException ioe) { return -1; } noUncompressedBytes = 0; } int n = 0; while ((n = decompressor.decompress(b, off, len)) == 0) { if (decompressor.finished() || decompressor.needsDictionary()) { if (noUncompressedBytes >= originalBlockSize) { eof = true; return -1; } } if (decompressor.needsInput()) { getCompressedData(); } } // Note the no. of decompressed bytes read from 'current' block noUncompressedBytes += n; return n; }
originalBlockSize = rawReadInt(); } catch (IOException ioe) { return -1;
originalBlockSize = rawReadInt(); } catch (IOException ioe) { return -1;
originalBlockSize = rawReadInt(); } catch (IOException ioe) { return -1;
originalBlockSize = rawReadInt(); } catch (IOException ioe) { return -1;
originalBlockSize = rawReadInt(); } catch (IOException ioe) { return -1;