You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Davanum Srinivas (JIRA)" <ji...@apache.org> on 2006/05/12 05:30:08 UTC

[jira] Created: (AXIS2-714) ConverterUtil#getStringFromDataHandler chops up the data into 1K chunks

ConverterUtil#getStringFromDataHandler chops up the data into 1K chunks
-----------------------------------------------------------------------

         Key: AXIS2-714
         URL: http://issues.apache.org/jira/browse/AXIS2-714
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug

    Reporter: Davanum Srinivas


Several decoders don't like it. especially XmlBeans. Better to use the following (tested and works)

    public static String getStringFromDatahandler(DataHandler dataHandler){
        try {
            InputStream inStream;
            inStream = dataHandler.getDataSource().getInputStream();
            byte[] data = IOUtils.getStreamAsByteArray(inStream);
            return Base64.encode(data);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS2-714) ConverterUtil#getStringFromDataHandler chops up the data into 1K chunks

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-714?page=all ]
     
Davanum Srinivas resolved AXIS2-714:
------------------------------------

    Resolution: Fixed

Fixed.

> ConverterUtil#getStringFromDataHandler chops up the data into 1K chunks
> -----------------------------------------------------------------------
>
>          Key: AXIS2-714
>          URL: http://issues.apache.org/jira/browse/AXIS2-714
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>     Reporter: Davanum Srinivas

>
> Several decoders don't like it. especially XmlBeans. Better to use the following (tested and works)
>     public static String getStringFromDatahandler(DataHandler dataHandler){
>         try {
>             InputStream inStream;
>             inStream = dataHandler.getDataSource().getInputStream();
>             byte[] data = IOUtils.getStreamAsByteArray(inStream);
>             return Base64.encode(data);
>         } catch (Exception e) {
>             throw new RuntimeException(e);
>         }
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira