bookkeeper-distributedlog-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leighst <...@git.apache.org>
Subject [GitHub] incubator-distributedlog pull request #21: DL-45: DL should allow ByteBuffer...
Date Fri, 18 Nov 2016 15:42:27 GMT
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?  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message