Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-07-14 Thread sebb
On 14/07/2008, Jochen Wiedmann <[EMAIL PROTECTED]> wrote: > On Mon, Jul 14, 2008 at 5:21 PM, sebb <[EMAIL PROTECTED]> wrote: > > > Just noticed https://issues.apache.org/jira/browse/CODEC-68 which > > implies that at least one person is expecting to be able to include > > invalid base64 characte

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-07-14 Thread Jochen Wiedmann
On Mon, Jul 14, 2008 at 5:21 PM, sebb <[EMAIL PROTECTED]> wrote: > Just noticed https://issues.apache.org/jira/browse/CODEC-68 which > implies that at least one person is expecting to be able to include > invalid base64 characters without a problem - in that case, after the > PAD characters. > > S

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-07-14 Thread sebb
On 14/07/2008, Jochen Wiedmann <[EMAIL PROTECTED]> wrote: > On Mon, Jul 14, 2008 at 3:37 PM, sebb <[EMAIL PROTECTED]> wrote: > > > Should have tried it before posting ... > > > > Both IOException and DecoderException are checked, and so this means > > that the method signature for > > > > pub

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-07-14 Thread Jochen Wiedmann
On Mon, Jul 14, 2008 at 3:37 PM, sebb <[EMAIL PROTECTED]> wrote: > Should have tried it before posting ... > > Both IOException and DecoderException are checked, and so this means > that the method signature for > > public static byte[] decodeBase64() > > would need to change - or the method needs

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-07-14 Thread sebb
On 14/07/2008, Jochen Wiedmann <[EMAIL PROTECTED]> wrote: > On Mon, Jul 14, 2008 at 2:24 PM, sebb <[EMAIL PROTECTED]> wrote: > > Just looked at this again. > > > > Using IOException causes problems, because the interface BinaryDecoder > > does not declare that as a possible exception. > > > >

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-07-14 Thread Jochen Wiedmann
On Mon, Jul 14, 2008 at 2:24 PM, sebb <[EMAIL PROTECTED]> wrote: > Just looked at this again. > > Using IOException causes problems, because the interface BinaryDecoder > does not declare that as a possible exception. > > How about using DecoderException instead? > > Seems just as appropriate to me

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-07-14 Thread sebb
Just looked at this again. Using IOException causes problems, because the interface BinaryDecoder does not declare that as a possible exception. How about using DecoderException instead? Seems just as appropriate to me. On 25/06/2008, Julius Davies <[EMAIL PROTECTED]> wrote: > +1 for IOExceptio

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-06-25 Thread Julius Davies
+1 for IOException. I've come around on this. Originally I liked garbage-in, garbage-out idea, but I'm +1 to IOException now. The reason I've come around is that I just cannot imagine any Java developer who would be confused or surprised when presented with an IOException in this situation. I'l

Re: [CODEC] Base64 decode() handling of invalid encoded data

2008-06-25 Thread Jochen Wiedmann
On Sat, Jun 21, 2008 at 2:19 PM, sebb <[EMAIL PROTECTED]> wrote: > How should Base64.decode() handle invalid encoded data? I'd vote for an IOException. As the RFC indicates, such characters are more than likely indicators for errors. If anyone requires such a message, it is easy to implement a Fi

[CODEC] Base64 decode() handling of invalid encoded data

2008-06-21 Thread sebb
How should Base64.decode() handle invalid encoded data? rfc2045 says: All line breaks or other characters not found in Table 1 must be ignored by decoding software. In base64 data, characters other than those in Table 1, line breaks, and other white space probably indicate a transmis