docs: public boolean writeTo(Packet packet, ByteBuffer dst) {
          if (!headerComplete) {
              if (dst.remaining() < HEADER_SIZE) {
                  return false;
              }
  
              dst.put(VERSION);
              dst.putChar(packet.getFlags());
              dst.putInt(packet.getPartitionId());
              size = packet.totalSize();
              dst.putInt(size);
              headerComplete = true;
          }
  
          if (writeValue(packet, dst)) {
              reset();
              return true;
          } else {
              return false;
          }
      }