@Override public int decompress(byte[] input, int offset, int length, OutputBuffer output) throws OrcCorruptionException { try { int uncompressedLength = SnappyDecompressor.getUncompressedLength(input, offset); if (uncompressedLength > maxBufferSize) { throw new OrcCorruptionException(orcDataSourceId, "Snappy requires buffer (%s) larger than max size (%s)", uncompressedLength, maxBufferSize); } // Snappy decompressor is more efficient if there's at least a long's worth of extra space // in the output buffer byte[] buffer = output.initialize(uncompressedLength + SIZE_OF_LONG); return decompressor.decompress(input, offset, length, buffer, 0, buffer.length); } catch (MalformedInputException e) { throw new OrcCorruptionException(e, orcDataSourceId, "Invalid compressed stream"); } }
int bytes = decompressor.decompress(compressed, 0, compressedChunkLength, userBuffer, userOffset, userLength); if (uncompressedChunkLength != bytes) { throw new IOException("Expected to read " + uncompressedChunkLength + " bytes, but data only contained " + bytes + " bytes");
int bytes = decompressor.decompress(compressed, 0, compressedChunkLength, userBuffer, userOffset, userLength); if (uncompressedChunkLength != bytes) { throw new IOException("Expected to read " + uncompressedChunkLength + " bytes, but data only contained " + bytes + " bytes");
@Override public int decompress(byte[] input, int offset, int length, OutputBuffer output) throws OrcCorruptionException { try { int uncompressedLength = SnappyDecompressor.getUncompressedLength(input, offset); if (uncompressedLength > maxBufferSize) { throw new OrcCorruptionException(orcDataSourceId, "Snappy requires buffer (%s) larger than max size (%s)", uncompressedLength, maxBufferSize); } // Snappy decompressor is more efficient if there's at least a long's worth of extra space // in the output buffer byte[] buffer = output.initialize(uncompressedLength + SIZE_OF_LONG); return decompressor.decompress(input, offset, length, buffer, 0, buffer.length); } catch (MalformedInputException e) { throw new OrcCorruptionException(e, orcDataSourceId, "Invalid compressed stream"); } }
@Override public int decompress(byte[] input, int offset, int length, OutputBuffer output) throws OrcCorruptionException { try { int uncompressedLength = SnappyDecompressor.getUncompressedLength(input, offset); if (uncompressedLength > maxBufferSize) { throw new OrcCorruptionException(orcDataSourceId, "Snappy requires buffer (%s) larger than max size (%s)", uncompressedLength, maxBufferSize); } // Snappy decompressor is more efficient if there's at least a long's worth of extra space // in the output buffer byte[] buffer = output.initialize(uncompressedLength + SIZE_OF_LONG); return decompressor.decompress(input, offset, length, buffer, 0, buffer.length); } catch (MalformedInputException e) { throw new OrcCorruptionException(e, orcDataSourceId, "Invalid compressed stream"); } }
@Override public int decompress(byte[] input, int offset, int length, OutputBuffer output) throws OrcCorruptionException { try { int uncompressedLength = SnappyDecompressor.getUncompressedLength(input, offset); if (uncompressedLength > maxBufferSize) { throw new OrcCorruptionException(orcDataSourceId, "Snappy requires buffer (%s) larger than max size (%s)", uncompressedLength, maxBufferSize); } // Snappy decompressor is more efficient if there's at least a long's worth of extra space // in the output buffer byte[] buffer = output.initialize(uncompressedLength + SIZE_OF_LONG); return decompressor.decompress(input, offset, length, buffer, 0, buffer.length); } catch (MalformedInputException e) { throw new OrcCorruptionException(e, orcDataSourceId, "Invalid compressed stream"); } }
this.valid = decompressor.decompress(input, frameData.offset, actualRead - frameData.offset, uncompressed, 0, uncompressed.length); this.buffer = uncompressed; this.position = 0;
this.valid = decompressor.decompress(input, frameData.offset, actualRead - frameData.offset, uncompressed, 0, uncompressed.length); this.buffer = uncompressed; this.position = 0;