문자 인코딩 값을 직접 지정하려면 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();
}
}
|
|