code: public void ensureSize(int bufSize, int pre, int post)
          throws IOException
      {
          // Do we have space?
          if (bufSize>_buf.length || pre>_preReserve || post>_postReserve)
          {
              // Make a bigger buffer if we are allowed.
              if (_fixed)
                  throw new IllegalStateException("Fixed");
  
              byte[] old=_buf;
              _buf=ByteArrayPool.getByteArray(bufSize);
  
              if (_pos>_start)
                  System.arraycopy(old,_start,_buf,pre,_pos-_start);
              if (!_resized)
                  ByteArrayPool.returnByteArray(old);
              
              _end=_buf.length-post;
              _preReserve=pre;
              _start=pre;
              _pos=pre;
              _postReserve=post;
          }
      }
docs: /* ------------------------------------------------------------