Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

copying file , results greater size

 
Mandita George
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello , I have a simple script that has to convert files from UTF8 to UTF7 , the thing is that after conversion , the resulting file is actually bigger

System : java1.6 on ubuntu 10
System 2: java 1.4 on aix 3

This is the code :

For example I have an mp3 of 104 KB, on the linux it results a file of 186 KB , on AIX it reults a file of 110 KB

I checked also on AIX because i know that all about ubuntu is buggy ,so I tested on AIX , but the same problem appears ( dont say AIX has a bad java implementation
 
Rob Camick
Ranch Hand
Posts: 2703
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be using InputStreams and OutputStreams to copy files, not Readers and Writers. Readers and Writers are for text files only. An MP3 file is not a text file.
 
Greg Charles
Sheriff
Posts: 3010
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For that matter, UTF7 and UTF8 are also only relevant to text. It's interesting that you get different results on different platforms. My guess would be the default encodings are different. However, what you're doing fundamentally makes no sense, so it's difficult to make sense of the results.
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You say your code has to convert UTF-8 to UTF-7, but then you posted code which doesn't do anything of the sort. And then you said you were trying to apply this code to an MP3 file, which isn't in UTF-8 format in the first place (as Rob said). So can you stop for a minute and explain what you are trying to do and (more importantly) why?

I don't want to hear that you want to convert UTF-8 to UTF-7. I want to hear why you want to do that.
 
Mandita George
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Rob Camick wrote:You should be using InputStreams and OutputStreams to copy files, not Readers and Writers. Readers and Writers are for text files only. An MP3 file is not a text file.


Hey man ,thanks, that was really a big one for me
Never thought that readers and writers are just for text
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!