Package java.io
Class InputStreamReader
String getEncoding()
_INSERT_METHOD_SIGNATURE_HERE_
Description:
Returns the canonical name of the character encoding being used by this stream. If this InputStreamReader was created with the InputStreamReader(InputStream, String) constructor then the returned encoding name, being canonical, may differ from the encoding name passed to the constructor. May return null if the stream has been closed.
Note that this method will always return "UTF8".
Example
File file = new File("testFile");
InputStream in = new FileInputStream(file);
InputStreamReader inr = new InputStreamReader(in);
Console.println("get encoding: " + inr.gerEncoding());
The example above prints the encoding to the console.