code: @Override
      public void write(int b) throws IOException {
          Exceptions.checkNotClosed(this.closed, this);
          Preconditions.checkState(this.currentFrame != null, "No current frame exists. Most likely no record is started.");
  
          int attemptCount = 0;
          int totalBytesWritten = 0;
          while (totalBytesWritten == 0 && attemptCount < 2) {
              // We attempt to write 1 byte. If append() says it wrote 0 bytes, it means the current frame is full. Seal it and create a new one.
              totalBytesWritten += this.currentFrame.append((byte) b);
              if (totalBytesWritten == 0) {
                  this.currentFrame.endEntry(false); // Close the current entry, and indicate it is not the last one of the record.
                  flush();
                  createNewFrame();
                  startNewRecordInCurrentFrame(false);
              }
  
              attemptCount++;
          }
  
          if (totalBytesWritten == 0) {
              throw new SerializationException("Unable to make progress in serializing to DataFrame.");
          }
      }
docs: region OutputStream Implementation