text: public virtual int read(byte[] buffer, int offset, int length){java.util.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 (System.IO.IOException e){if (i != 0){return i;}throw;}buffer[offset + i] = unchecked((byte)c);}}return length;}