wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes NIO and Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "NIO and Internationalization" Watch "NIO and Internationalization" New topic
Author

NIO and Internationalization

Lanny Gilbert
Ranch Hand

Joined: Jun 11, 2002
Posts: 103
Greetings from beautiful Sandy Springs, Georgia.
Since I'm studying for the SCEA exam, streams and internalization are on my mind quite a bit these days.
How does NIO provide for internationalization?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Mhh, it seems to me that NIO is mainly about the mechanics of writing/reading something, whereas i18n is about *what* to write. So, aren't that somewhat orthogonal issues?
What would you expect from NIO in regards to i18n?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
In traditional IO, InputStreamReader and OutputStreamWriter provide for conversion between byte streams and character streams (Readers and Writers) using named character encodings. NIO has similar functionality provided by Charset, CharsetEncoder and CharsetDecoder. These do things like convert a ByteBuffer into a CharBuffer view and vice versa.


"I'm not back." - Bill Harding, Twister
Ron Hitchens
Author
Ranch Hand

Joined: Mar 17, 2003
Posts: 30
As the previous posters have pointed out, NIO doesn't directly address I18N. There is a new package in NIO, java.nio.charset, which is all about character sets but it's concerned only with transcoding between character sequences and byte streams.
NIO is really only involved at the plumbing level in I18N. The Charset class let's you define your own character sets and gives you complete control over their endcoding/decoding rules.
Character sets you create may be added to the JVM for general use (including by Readers and Writers) but that's the extent of it. NIO knows nothing about Locales, number formatting conventions, etc.
So international character sets can be built and deployed with NIO. But if I18N is your thing, you'll probably not deal directly with NIO very often.


Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596002882/ref=jranch-20" target="_blank" rel="nofollow">Java NIO</a> (<a href="http://javanio.info" target="_blank" rel="nofollow">javanio.info</a>)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NIO and Internationalization
 
Similar Threads
Internationalization in Log4j
NX:NIO ??
Struts interview questions...
Internationalization
java