BufferOutoutStream:
BufferOutoutStream.write(byte[] buffer, int offset, int length):
buffer | the buffer to be written. |
---|---|
offset | the start position in buffer from where to get bytes. |
length | the number of bytes from buffer to write to this stream. |
InputStream:
InputStream.read(byte[] buffer, int byteOffset, int byteCount)
从Inputstream流中读取byteCount个字节保存到以byteOffset开头(指针位置)的buffer中。
RandomAccessFile:
read(byte[] buffer , int byteOffset , int byteCount)
从流中的当前位置(指针)读取byteCount个字节保存在以byteOffset位置(指针位置)开始的buffer中。返回实际读到的字节数,如果读到流的结尾返回-1
write(byte[] buffer, int byteOffset, int byteCount)
buffer | the buffer to write. |
---|---|
byteOffset | the index of the first byte in buffer to write. |
byteCount | the number of bytes from the buffer to write. |