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;}}}}

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 ; } } } }
public override void write(char[] cbuf, int offset, int count){lock (@lock){checkNotClosed();if (cbuf == null){throw new System.ArgumentNullException("buffer == null");}java.util.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.Array.Copy(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.Array.Copy(cbuf, offset, this.buf, pos, available);pos += available;}}}}
