code: public static void putByteArrayValue(WsByteBuffer[] list, byte[] value, boolean bFlipLast) {
          if (null == list || null == value) {
              return;
          }
          if (value.length > getTotalCapacity(list)) {
              throw new IllegalArgumentException("Buffers not large enough");
          }
          int remaining = value.length;
          int offset = 0; // current offset into the value
          int avail = 0;
          for (int i = 0; i < list.length; i++) {
              avail = list[i].limit() - list[i].position();
              if (remaining <= avail) {
                  list[i].put(value, offset, remaining);
                  if (bFlipLast) {
                      list[i].flip();
                  }
                  break;
              }
              list[i].put(value, offset, avail);
              list[i].flip();
              offset += avail;
              remaining -= avail;
          }
      }
docs: Store a byte[] into a wsbb[]. This will fill out each wsbb until
  all of the bytes are written. It will throw an exception if there
  is not enough space. Users must pass in a boolean to determine
  whether or not to flip() the last buffer -- i.e. pass in true if
  this is the only put you're doing, otherwise pass in false. Any
  intermediate buffers that are filled to capacity will be flip()'d
  automatically. A null input value will result in a no-op.
  
  @param list
  @param value
  @param bFlipLast