自分で文字エンコード方式の値を指定するには、FileInputStream で CharsetDecoder を使用して InputStreamReader を構成します。
public static void main( String[] args ) {
InputStreamReader reader = null;
try {
reader = new InputStreamReader( new FileInputStream("file1"), "UTF-16BE");
System.out.println( reader.read() );
} catch ( IOException e ) {
e.printStackTrace();
}
}
|
|