DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21800>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21800

because The OutputStreamWriter not flush, so short String will  encoded error...

           Summary: because The OutputStreamWriter not flush, so short
                    String will  encoded error...
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Codec
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


because The OutputStreamWriter not flush, so short String will  encoded error...


org.apache.commons.codec.base64 bug, i coreect,anyone can notify the committer 

public static String encode(String data, String
charEncoding)
        throws UnsupportedEncodingException {

        // Check arguments
        if (data == null) {
            data = "";
        }
        if (charEncoding == null) {
            charEncoding = DEFAULT_CHAR_ENCODING;
        }

        // Convert to byte[]
        ByteArrayOutputStream bos = new
ByteArrayOutputStream();
        OutputStreamWriter osw = new
OutputStreamWriter(bos, charEncoding);
        try {
            osw.write(data);
//*****should add start*********
            osw.flush()
//*****should add end*********

        } catch (IOException ioe) {
            throw new
RuntimeException(ioe.toString());
        }

        // Encode
        byte[] encodedData =
encode(bos.toByteArray());

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to