En-code/De-code

BufferedReader in = new BufferedReader(new FileReader("C:\\DOC.xml"));String line = in.readLine(); ByteBuffer bb = ByteBuffer.wrap(line.getBytes("US-ASCII"));
Charset csets = Charset.forName("US-ASCII");
ByteBuffer ebb = csets.encode(bb.asCharBuffer());
byte[] buf = ebb2.array();

String result = new String(buf);