S
Sard
The ByteArrayInputStream class has a read method which is "the buffer
into which the data is read". How can this be possible if arguments
are always passed by value?
read
public int read(byte[] b,
int off,
int len)
Reads up to len bytes of data into an array of bytes from this
input stream. If pos equals count, then -1 is returned to indicate end
of file. Otherwise, the number k of bytes read is equal to the smaller
of len and count-pos. If k is positive, then bytes buf[pos] through
buf[pos+k-1] are copied into b[off] through b[off+k-1] in the manner
performed by System.arraycopy. The value k is added into pos and k is
returned.
This read method cannot block.
Overrides:
read in class InputStream
Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Returns:
into which the data is read". How can this be possible if arguments
are always passed by value?
read
public int read(byte[] b,
int off,
int len)
Reads up to len bytes of data into an array of bytes from this
input stream. If pos equals count, then -1 is returned to indicate end
of file. Otherwise, the number k of bytes read is equal to the smaller
of len and count-pos. If k is positive, then bytes buf[pos] through
buf[pos+k-1] are copied into b[off] through b[off+k-1] in the manner
performed by System.arraycopy. The value k is added into pos and k is
returned.
This read method cannot block.
Overrides:
read in class InputStream
Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Returns: