private ByteBuffer expandBuffer(ByteBuffer original,int cap){
  ByteBuffer res=directBuf ? ByteBuffer.allocateDirect(cap) : ByteBuffer.allocate(cap);
  res.order(order);
  original.flip();
  res.put(original);
  return res;
}

private ByteBuffer expandBuffer ( ByteBuffer original , int cap ) { ByteBuffer res = directBuf ? ByteBuffer . allocateDirect ( cap ) : ByteBuffer . allocate ( cap ) ; res . order ( order ) ; original . flip ( ) ; res . put ( original ) ; return res ; }
expands the given byte buffer to the requested capacity .
