class ByteArrayWriter extends Writer {

    @Override
    public void write(char[] cbuf, int off, int len) {
        ensureCapacity(position + len);
        if ((off < 0) || (off > cbuf.length) || (len < 0) ||
                ((off + len) > cbuf.length) || ((off + len) < 0)) {
            throw new IndexOutOfBoundsException();
        } else if (len == 0) {
            return;
        }
        buffer.write(cbuf, off, len, position);
        position += len;
    }

    public  ByteArrayWriter();
    public  ByteArrayWriter(int initialSize);
    public  ByteArrayWriter(ByteArray buffer);

}