Могу ли я коснуться байтов, которые запрашиваются для чтения, но не читаются в реальности InputStream?JAVA

Программисты JAVA общаются здесь
Anonymous
Могу ли я коснуться байтов, которые запрашиваются для чтения, но не читаются в реальности InputStream?

Сообщение Anonymous »


In official JDK docs, the java.io.InputStream#read(byte[], int, int) said:

Let k be the number of bytes actually read; these bytes will be stored in elements b[off] through b[off+k-1], leaving elements b[off+k] through b[off+len-1] unaffected.

But after the sentence, the next paragraph said:

In every case, elements b[0] through b[off-1] and elements b[off+len] through b[b.length-1] are unaffected.

The first sentence requires a more strong limitation of the read operation. Which one is enough?

No reproducible example need.


Источник: https://stackoverflow.com/questions/781 ... ity-of-inp

Вернуться в «JAVA»