commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amit Sharma (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CODEC-108) Base64 encoding issue for larger avi files
Date Thu, 13 Jan 2011 02:41:45 GMT

    [ https://issues.apache.org/jira/browse/CODEC-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12981096#action_12981096
] 

Amit Sharma commented on CODEC-108:
-----------------------------------

private String getInputData(String inputDataFile2) {

		 String tempStr = null;
		 String finalString = null;
		 BufferedReader br = null;
		 InputStream  inputStream = null;
		 StringBuffer buff = new StringBuffer();
		try{
		 System.out.println("inputDataFile2 is: "+inputDataFile2);
		 inputStream = this.getClass().getClassLoader().getResourceAsStream(inputDataFile2);
		 br = new BufferedReader(new InputStreamReader(inputStream));
		 while ((tempStr = br.readLine()) != null){
			 buff.append(tempStr);
			    //buff.setLength(0);
			    //buff = null; 
			}
		 
		} catch (Exception e) {
			System.out.println("cannot read file");
			} finally {
			try {
				inputStream.close();
				br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		finalString = buff.toString();
		buff.setLength(0);
		buff = null;
		return finalString;
	}

mimeData.setByteArrayValue(Base64.encodeBase64(inputData.getBytes(), false));

conversion is not appropiatly done....file getting reducing while decoding it.....do we need
to apply some other way of encoding ?

> Base64 encoding issue for larger avi files
> ------------------------------------------
>
>                 Key: CODEC-108
>                 URL: https://issues.apache.org/jira/browse/CODEC-108
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Amit Sharma
>
> I am using base64.encode/decode for xml files..it works fine with smaller files. But,
when i try to encode larger avi files using Base64 encoder..it reduces file size. 
> Could you please tell me, why its happening ??

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message