You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Andreas Loth (Jira)" <ji...@apache.org> on 2023/10/19 11:42:00 UTC
[jira] [Comment Edited] (IO-427) New TrailerInputStream class
[ https://issues.apache.org/jira/browse/IO-427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17775595#comment-17775595 ]
Andreas Loth edited comment on IO-427 at 10/19/23 11:41 AM:
------------------------------------------------------------
The TIKA implementation works differently than the one on [https://github.com/apache/commons-io/pull/497]:
TIKA returns all bytes (including the trailer) with the "normal" read calls.
PR#497 does not return the trailer bytes during "normal" read calls.
Imagine you're transferring a file with appended SHA-256 hash.
When you copy the input stream to a file on disk. With the TIKA implementation, you end with payload+hash on disk. With the PR#497 implementation, only the payload gets written to disk.
was (Author: JIRAUSER299707):
The TIKA implementation works differently than the one on https://github.com/apache/commons-io/pull/497:
TIKA returns all bytes (including the trailer) with the "normal" read calls.
PR#497 does not return the trailer bytes during "normal" read calls.
Imagine you're transferring a file with appended SHA-256 hash.
When you copy the input stream to a file on disk. With the TIKA implementation, you end with payload+hash on disk. With the PR#497 implementation, only the payload gets written to disk.
> New TrailerInputStream class
> ----------------------------
>
> Key: IO-427
> URL: https://issues.apache.org/jira/browse/IO-427
> Project: Commons IO
> Issue Type: New Feature
> Components: Streams/Writers
> Reporter: Duncan Jones
> Priority: Minor
> Labels: patch
> Attachments: TrailerInputStream.java, TrailerInputStreamTest.java
>
>
> A new input stream for reading data with fixed length trailers/suffixes. This was briefly discussed on the ML: http://markmail.org/thread/mh4elj7a53mdus2h.
> Since I don't often write input streams and haven't contributed to this project before, I offer this up for review to see if it's a welcome addition.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)