code: @Override
      public synchronized void write(final byte[] b, final int off, final int len) {
          if (off < 0 || off > b.length || len < 0 || off + len - b.length > 0) {
              throw new IndexOutOfBoundsException();
          }
          ensureCapacity(super.count + len);
          System.arraycopy(b, off, super.buf, super.count, len);
          super.count += len;
      }
docs: /*
  (non-Javadoc)
  
  @see java.io.ByteArrayOutputStream#write(byte[], int, int)