steveloughran commented on code in PR #3550:
URL: https://github.com/apache/parquet-java/pull/3550#discussion_r3202032030


##########
parquet-common/src/main/java/org/apache/parquet/bytes/BytesInput.java:
##########
@@ -395,8 +404,11 @@ void writeInto(ByteBuffer buffer) {
 
     public byte[] toByteArray() throws IOException {
       LOG.debug("read all {} bytes", byteCount);
-      byte[] buf = new byte[byteCount];
-      new DataInputStream(in).readFully(buf);
+      byte[] buf = in.readNBytes(byteCount);

Review Comment:
   hadn't noticed this before. Doesn't look like anything in the JDK has 
actually subclassed it ... that is there's no AFAIK there's no faster native 
code version. That's probably because java.nio is the way to go there



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to