File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes Read/write values into java memory Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Read/write values into java memory" Watch "Read/write values into java memory" New topic
Author

Read/write values into java memory

Hari Dhanakoti
Ranch Hand

Joined: Jan 07, 2008
Posts: 74
So, far I have tried to write the byte values wit the encoding format "ISO-8859-1" using ByteArrayInputStream(b),Charset.forName("ISO-8859-1");

How the values of the string be written to the java memory?

When I try to read the value in a stream how they should be read with the same encoding format (ISO-8859-1)?


Regards,
Hari
Greg Charles
Bartender

Joined: Oct 01, 2001
Posts: 1620

Strings are always stored in Java memory as a collection of two byte Unicode characters. You don't have any control over that. How you read or write Strings with streams depends what's on the other end of that stream. You could certainly read or write the Unicode characters without any conversion, but if you are talking to another program that doesn't understand Unicode, you will have ... a failure to communicate.
 
 
subject: Read/write values into java memory
 
MyEclipse, The Clear Choice