[ https://issues.apache.org/jira/browse/DL-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15676980#comment-15676980 ]
ASF GitHub Bot commented on DL-45: ---------------------------------- Github user leighst commented on a diff in the pull request: https://github.com/apache/incubator-distributedlog/pull/21#discussion_r88676658 --- Diff: distributedlog-core/src/main/java/com/twitter/distributedlog/EnvelopedEntry.java --- @@ -290,7 +290,8 @@ public static InputStream fromInputStream(InputStream src, src.reset(); EnvelopedEntry entry = new EnvelopedEntry(version, statsLogger); entry.readFully(new DataInputStream(src)); - return new ByteArrayInputStream(entry.getDecompressedPayload()); + return new ByteArrayInputStream(entry.getDecompressedPayload().array()); --- End diff -- i think im missing something here, but it seems like a bad idea to use direct array access since the payload object could have been initialized with a ByteBuffer from anywhere. is this safe? > DL should allow ByteBuffer based API and should avoid copying of arrays > ----------------------------------------------------------------------- > > Key: DL-45 > URL: https://issues.apache.org/jira/browse/DL-45 > Project: DistributedLog > Issue Type: Improvement > Components: distributedlog-core, distributedlog-protocol > Reporter: Arvind Kandhare > -- This message was sent by Atlassian JIRA (v6.3.4#6332)