MCPcopy Create free account
hub / github.com/apache/orc / decompress

Method decompress

java/core/src/java/org/apache/orc/impl/ZstdCodec.java:228–246  ·  view source on GitHub ↗
(ByteBuffer in, ByteBuffer out)

Source from the content-addressed store, hash-verified

226 }
227
228 @Override
229 public void decompress(ByteBuffer in, ByteBuffer out) throws IOException {
230 if (in.isDirect() && out.isDirect()) {
231 directDecompress(in, out);
232 return;
233 }
234
235 int srcOffset = in.arrayOffset() + in.position();
236 int srcSize = in.remaining();
237 int dstOffset = out.arrayOffset() + out.position();
238 int dstSize = out.remaining() - dstOffset;
239
240 long decompressOut =
241 Zstd.decompressByteArray(out.array(), dstOffset, dstSize, in.array(),
242 srcOffset, srcSize);
243 in.position(in.limit());
244 out.position(dstOffset + (int) decompressOut);
245 out.flip();
246 }
247
248 @Override
249 public boolean isAvailable() {

Callers 2

testCorruptMethod · 0.95

Calls 2

directDecompressMethod · 0.95
flipMethod · 0.80

Tested by 2

testCorruptMethod · 0.76