def encode(self):
        if len(self.data) == 0:
            log.debug("Encoding an empty DAT packet")
        format = "!HH%ds" % len(self.data)
        self.buffer = struct.pack(format,
                                  self.opcode,
                                  self.blocknumber,
                                  self.data)
        return self
Encode the DAT packet. This method populates self.buffer, and
dataset/ETHPy150Open msoulier/tftpy/tftpy/TftpPacketTypes.py/TftpPacketDAT.encode