Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFcccc
try {
  DataInputStream dis = null;
  try {
    dis = new DataInputStream(new FileInputStream("data"));
    // Little-endian data might be read as big-endian
    int serialNumber = dis.readInt();
  } catch (IOException x) {
    // handle error
  } finally {
    if (dis != null) {
      try {
       dis.close();
      } catch (IOException e) {
      // handle error
      }
    }
  }
}

Compliant Solution (ByteBuffer)

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="18f31858b5e877f1-ce92e242-466b42fa-a66493e9-d02f3010fc58323f44259619"><ac:plain-text-body><![CDATA[

[[API 2006

AA. References#API 06]]

[Class ByteBuffer

http://download.oracle.com/javase/6/docs/api/java/nio/ByteBuffer.html]: Methods wrap and order. [Class Integer

http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html]: method reverseBytes

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="20913b5dfcbdd629-4441c462-440646d3-b7058203-62bf08941ebe36d28810f2d0"><ac:plain-text-body><![CDATA[

[[Cohen 1981

AA. References#Cohen 81]]

On Holy Wars and a Plea for Peace

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="fa1eaca46bb69822-38ba3dde-43c04dbc-888087e3-dd92aa56e91fd3cbffef9708"><ac:plain-text-body><![CDATA[

[[Harold 1997

AA. References#Harold 97]]

Chapter 2, Primitive Data Types, Cross-Platform Issues

]]></ac:plain-text-body></ac:structured-macro>

...