text: public int read(byte[] buffer, int offset, int length) throws IOException {Arrays.checkOffsetAndCount(buffer.length, offset, length);for (int i = 0; i < length; i++) {int c;try {if ((c = read()) == -1) {return i == 0 ? -1 : i;}} catch (IOException e) {if (i != 0) {return i;}throw e;}buffer[offset + i] = (byte) c;}return length;}