code: public void ensureReserve(int n)
      {
          if (n>_start)
          {
              if (log.isDebugEnabled())log.debug("Reserve: "+n+">"+_start);
              if ((_pos+n)<_end)
              {
                  if (log.isDebugEnabled())log.debug("Shift reserve: "+_pos+"+"+n+"<"+_end);
                  System.arraycopy(_buf,_start,_buf,n,_pos-_start);
                  _pos=_pos+n-_start;
                  _start=n;
              }
              else
              {
                  if (log.isDebugEnabled())log.debug("New reserve: "+_pos+"+"+n+">="+_end);
                  byte[] buf = new byte[_buf.length+n-_start];
                  System.arraycopy(_buf,_start,buf,n,_pos-_start);
                  _pos=n+_pos-_start;
                  _start=n;
                  _buf=buf;
                  _end=_buf.length-_postReserve;
              }
          }
      }
docs: /* ------------------------------------------------------------