code: static public int getBytes(WsByteBuffer wsbb, byte[] dst, int offset) {
          try {
              // Use the buffers bulk get method
              wsbb.get(dst, offset, dst.length - offset);
              return dst.length;
          } catch (BufferUnderflowException bue) {
              // no FFDC required
              int numOfBytesAvail = wsbb.remaining();
              wsbb.get(dst, offset, numOfBytesAvail);
              return (offset + numOfBytesAvail);
          }
      }
docs: This method reads data from the WsByteBuffer and writes it
  to the byte array. The number of the bytes read is the length
  of the passed byte array. if the data in the WsByteBuffer is not
  sufficient then it reads the max. no. of bytes possible.
  It returns the <b>total</b> number of bytes read into the byte
  array.
  
  @param wsbb Read WsBytebuffer
  @param dst Write byte array
  @param offset start of write position in the byte array
  @return (offset + no. of bytes read)