[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: [jira] [Commented] (CODEC-183) BaseNCodecOutputStream only supports writing EOF on close()
From: "Gary Gregory (JIRA)" <jira () apache ! org>
Date: 2014-10-30 15:26:34
Message-ID: JIRA.12702373.1395233841000.373089.1414682794026 () Atlassian ! JIRA
[Download RAW message or body]
[ https://issues.apache.org/jira/browse/CODEC-183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14190227#comment-14190227 \
]
Gary Gregory commented on CODEC-183:
------------------------------------
Patch/commit away! :-_
> BaseNCodecOutputStream only supports writing EOF on close()
> -----------------------------------------------------------
>
> Key: CODEC-183
> URL: https://issues.apache.org/jira/browse/CODEC-183
> Project: Commons Codec
> Issue Type: Bug
> Affects Versions: 1.6
> Environment: I'm running with version 1.6, but quick look shows it's present in \
> 1.8.
> Reporter: Steven Wurster
>
> The only way to add the EOF marker when encoding or decoding with the \
> BaseNCodecOutputStream is via the close() function. The flush() function does not \
> perform this logic, and it is questionable whether or not it should. The problem is \
> that I want to write to a Base64OutputStream in the middle of writing to another \
> stream. That is, I will write some content to a stream, then wrap that stream with \
> a Base64OutputStream to write some more (encoded) content, and then finish writing \
> directly to the original stream (and so not encoded). Calling flush() on the \
> Base64OutputStream will not write the EOF marker, which means bytes can be lost. I \
> do not want to call close() on the Base64OutputStream as that will propagate to my \
> original stream, which I need to leave open. Ideas for resolving this include the \
> following:
> * Adding a separate function for writing the final (EOF) bytes without an explicit \
> close (hacky solution).
> * Changing the visibility of various functions and members so that I can write my \
> own descendant that provides the functionality I want. Note that the encode() and \
> decode() functions on BaseNCodec used in the close() routine are package-private, \
> and so I cannot call them within a descendant.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic