int (@NotNull byte[] b, int off, int len) { if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } if (myPosition >= myCount) { return -1; } if (myPosition + len > myCount) { len = myCount - myPosition; } if (len <= 0) { return 0; } System.arraycopy(myBuffer, myPosition, b, off, len); myPosition += len; return len; }