code: public ArrayList<Frame> prepareBody(WsByteBuffer[] wsbb, int length, boolean isFinalWrite) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "prepareBody entry : final write: " + isFinalWrite);
  
          }
          ArrayList<Frame> dataFrames = new ArrayList<Frame>();
          FrameData dataFrame;
  
          if (wsbb == null || length == 0) {
              // this empty data frame will have an end of stream flag set, signalling stream closure
              dataFrame = new FrameData(streamID, null, 0, isFinalWrite);
              dataFrames.add(dataFrame);
              return dataFrames;
          }
          boolean endStream = isFinalWrite;
          boolean lastData = false;
          int lengthWritten = 0;
  
          // if there's more than one buffer passed in we can't assume it will end the stream
          if (wsbb.length > 1) {
              endStream = false;
          }
          // create a data frame for every buffer in the array
          for (int i = 0; i < wsbb.length; i++) {
              WsByteBuffer b = wsbb[i];
  
              if (b == null) {
                  continue;
              }
  
              lengthWritten += b.remaining();
  
              if (b.remaining() != 0) {
                  if (lengthWritten >= length) {
                      // the current buffer meets the expected total write length,
                      // so we'll mark this as the last data frame on the stream
                      lastData = true;
                      endStream = lastData && isFinalWrite ? true : false;
                  }
  
                  dataFrame = new FrameData(streamID, b, b.remaining(), endStream);
                  dataFrames.add(dataFrame);
  
                  if (lastData) {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "prepareBody exit : " + dataFrames);
                      }
                      return dataFrames;
                  }
              }
          }
          return dataFrames;
      }
docs: Create Data frames to contain the http body payload
  The buffers passed in must not exceed the http2 max frame size
  
  @param WsByteBuffer[]
  @param int length
  @param boolean isFinalWrite
  @return ArrayList<Frame> of FrameData objects containing the buffered payload data