docs: public byte[] getBuffer() {
          if(buf == null)
              return null;
          if(offset == 0 && length == buf.length)
              return buf;
          else {
              byte[] retval=new byte[length];
              System.arraycopy(buf, offset, retval, 0, length);
              return retval;
          }
      }