Versions Compared

Key

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

...

Code Block
bgColor#ccccff
public static int readSafe(BufferedReader buffer, char[] cbuf, int off, int len) throws EOFExceptionIOException {
  int read = buffer.read(cbuf, off, len);
  if (read == -1) {
     throw new EOFException();
  } else {
     return read;
  }
}

// ...

BufferedReader buffRdr;

// set up buffRdr

try {
   read = readSafe(buffRdr, chBuff, 0, MAX_READ);
   chBuff[read] = TERMINATOR;
} catch (EOFException eof) {
   chBuff[0] = TERMINATOR;
}

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0655bbff9ea50a55-6418650c-4342464f-97c39bc7-076f1514f4b48a298f982d20"><ac:plain-text-body><![CDATA[

[[API 2006

AA. References#API 06]]

[Class Reader

http://download.oracle.com/javase/6/docs/api/java/io/Reader.html]

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

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="620ff23d11e1bcf7-2de56c68-45c1437b-94d8ad25-3ff4be82aca8fb6bb84ba661"><ac:plain-text-body><![CDATA[

[[JLS 2011

AA. References#JLS 11]]

Chapter 11. Exceptions

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