The contracts of the read methods for {{Wiki Markup InputStream}} and {{Reader}} classes and their subclasses are complicated with regard to filling byte or character arrays. According to the Java API \ [[API 2006|AA. References#API 06]\] for the class {{InputStream}}, the {{read(byte\[\] b, int off, int len)}} method provides the following behavior:
The default implementation of this method blocks until the requested amount of input data
lenhas been read, end of file is detected, or an exception is thrown. Subclasses are encouraged to provide a more efficient implementation of this method.
However, the {{Wiki Markup read(byte\[\])}} method:
reads some number of bytes from the input stream and stores them into the buffer array
b. The number of bytes actually read is returned as an integer. The number of bytes read is, at most, equal to the length ofb.
...
Bibliography
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f826b200-1df0-4fee-a5c1-61e0398d6aed"><ac:plain-text-body><! [CDATA[ [[API 2006AA. References#API 06]] | Class | |
[CDATA[ [[Chess 2007AA. References#Chess 07] ] | 8.1, Handling Errors with Return Codes ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="79a70978-f101-4f0a-a01e-a0d424027140"><ac:plain-text-body><![CDATA[ | [ [Harold 1999AA. References#Harold 99] ] | Chapter 7, Data Streams, Reading Byte Arrays ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e082ce86-2a94-414f-ac0f-e9494beae788"><ac:plain-text-body><![CDATA [ [[Phillips 2005AA. References#Phillips 05] ] | ]]></ac:plain-text-body></ac:structured-macro> |
...
12. Input Output (FIO) FIO11-J. Do not attempt to read raw binary data as character data