• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

NIO and Internationalization  RSS feed

 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Author
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!