...
Code Block | ||
---|---|---|
| ||
FileInputStream fis = null; try { fis = new FileInputStream("SomeFile"); DataInputStream dis = new DataInputStream(fis); byte[] data = new byte[1024]; dis.readFully(data); String encoding = "SomeEncoding"; // for example, "UTF-16LE" String result = new String(data, encoding); } catch (IOException x) { // handle error } finally { if (fis != null) { try { fis.close(); } catch (IOException x) { // Forward to handler } } } |
Exceptions
IDS13-EX0: An explicit character encoding may be omitted on the receiving side when the data is produced by a Java application that uses the same platform and default character encoding and is communicated over a secure communication channel (see MSC00-J for more information).
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="70aa376c17a25191-5e99ac3e-43b1477a-b0c7abd8-30a6ffc68361cb10b99fe9c1"><ac:plain-text-body><![CDATA[ | [[Encodings 2006 | AA. Bibliography#Encodings 06]] | ]]></ac:plain-text-body></ac:structured-macro> |
...