Skip to content

Commit fb1c4cb

Browse files
cxzl25deshanxiao
authored andcommitted
ORC-1623: Use directOut.put(out) instead of directOut.put(out.array()) in TestZstd test
### What changes were proposed in this pull request? This PR aims to use `directOut.put(out)` instead of `directOut.put(out.array())` in `TestZstd` test. ### Why are the changes needed? Improve the readability of test code. ### How was this patch tested? GA ### Was this patch authored or co-authored using generative AI tooling? No Closes #1806 from cxzl25/ORC-1623. Authored-by: sychen <[email protected]> Signed-off-by: deshanxiao <[email protected]>
1 parent 4f93ca9 commit fb1c4cb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

java/core/src/test/org/apache/orc/impl/TestZstd.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,10 @@ public void testZstdDirectDecompress() {
136136
// write bytes to heap buffer.
137137
assertTrue(zstdCodec.compress(in, out, null,
138138
zstdCodec.getDefaultOptions()));
139-
int position = out.position();
140139
out.flip();
141140
// copy heap buffer to direct buffer.
142-
directOut.put(out.array());
141+
directOut.put(out);
143142
directOut.flip();
144-
directOut.limit(position);
145143

146144
zstdCodec.decompress(directOut, directResult);
147145

0 commit comments

Comments
 (0)