code: @Override
  	public void serializeRecord(T record) throws IOException {
  		if (CHECKED) {
  			if (dataBuffer.hasRemaining()) {
  				throw new IllegalStateException("Pending serialization of previous record.");
  			}
  		}
  
  		serializationBuffer.clear();
  		lengthBuffer.clear();
  
  		// write data and length
  		record.write(serializationBuffer);
  
  		int len = serializationBuffer.length();
  		lengthBuffer.putInt(0, len);
  
  		dataBuffer = serializationBuffer.wrapAsByteBuffer();
  	}
docs: Serializes the complete record to an intermediate data serialization buffer.
  
  @param record the record to serialize