text: public void write(char[] cbuf, int offset, int count) throws IOException {synchronized (lock) {checkNotClosed();if (cbuf == null) {throw new NullPointerException("buffer == null");}Arrays.checkOffsetAndCount(cbuf.length, offset, count);if (pos == 0 && count >= this.buf.length) {out.write(cbuf, offset, count);return;}int available = this.buf.length - pos;if (count < available) {available = count;}if (available > 0) {System.arraycopy(cbuf, offset, this.buf, pos, available);pos += available;}if (pos == this.buf.length) {out.write(this.buf, 0, this.buf.length);pos = 0;if (count > available) {offset += available;available = count - available;if (available >= this.buf.length) {out.write(cbuf, offset, available);return;}System.arraycopy(cbuf, offset, this.buf, pos, available);pos += available;}}}}