def METHOD_NAME(self, write_buffer: WriteBuffer):
    write_buffer.push_context("ModbusPDUReadFileRecordResponseItem")
    # Implicit Field (data_length) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
    data_length: int = int(len(self.data)) + int(1)
    write_buffer.write_unsigned_byte(data_length, logical_name="dataLength")
    # Simple Field (referenceType)
    write_buffer.write_unsigned_byte(
        self.reference_type, logical_name="referenceType"
    )
    # Array Field (data)
    write_buffer.write_byte_array(self.data, logical_name="data")
    write_buffer.pop_context("ModbusPDUReadFileRecordResponseItem")