@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"); } }
uncompressedChunkLength = SnappyDecompressor.getUncompressedLength(compressed, 0); if (uncompressedChunkLength > uncompressedBlockLength) { throw new IOException("Chunk uncompressed size is greater than block size");
uncompressedChunkLength = SnappyDecompressor.getUncompressedLength(compressed, 0); if (uncompressedChunkLength > uncompressedBlockLength) { throw new IOException("Chunk uncompressed size is greater than block size");
@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"); } }
int uncompressedLength = SnappyDecompressor.getUncompressedLength(input, frameData.offset);
int uncompressedLength = SnappyDecompressor.getUncompressedLength(input, frameData.offset);