code: int append(ByteArraySegment data) {
          ensureAppendConditions();
  
          int actualLength = Math.min(data.getLength(), getAvailableLength());
          if (actualLength > 0) {
              this.contents.copyFrom(data, writePosition, actualLength);
              writePosition += actualLength;
          }
  
          return actualLength;
      }
docs: Appends the contents of the ByteArraySegment to the DataFrame.
  
  @param data The ByteArraySegment to append.
  @return The number of bytes written. If less than the length of the ByteArraySegment, the frame is full and cannot
  write anything anymore. The remaining bytes will need to be written to a new frame.
  @throws IllegalStateException If the frame is sealed or no entry has been started.