/** * Write a portion of an array of characters. * * @param cbuf Array of characters * @param off Offset from which to start writing characters * @param len Number of characters to write * @throws java.io.IOException If an I/O error occurs */ public void write( final byte[] cbuf, final int off, final int len ) throws IOException { if ( len < 0 ) { throw new IllegalArgumentException(); } if ( off < 0 ) { throw new IndexOutOfBoundsException(); } if ( cbuf == null ) { throw new NullPointerException(); } if ( ( len + off ) > cbuf.length ) { throw new IndexOutOfBoundsException(); } ensureSize( cursor + len ); System.arraycopy( cbuf, off, this.buffer, cursor, len ); cursor += len; }
/** * Write a portion of an array of characters. * * @param cbuf Array of characters * @param off Offset from which to start writing characters * @param len Number of characters to write * @throws java.io.IOException If an I/O error occurs */ public void write(final byte[] cbuf, final int off, final int len) throws IOException { if (len < 0) { throw new IllegalArgumentException(); } if (off < 0) { throw new IndexOutOfBoundsException(); } if (cbuf == null) { throw new NullPointerException(); } if ((len + off) > cbuf.length) { throw new IndexOutOfBoundsException(); } ensureSize(cursor + len); System.arraycopy(cbuf, off, this.buffer, cursor, len); cursor += len; }