public byte[] ToByteArray()
        {
            PacketBuffer buffer = new PacketBuffer();

            buffer.WriteBytes(Encoding.ASCII.GetBytes(PacketType));
            buffer.WriteInteger(TransferID);
            return(buffer.ToArray());
        }
Example #2
0
        public TransferRequestPacket(LocalFileStructure fStruct, int localID)
        {
            PacketBuffer buffer = new PacketBuffer();

            buffer.WriteInteger(localID);
            buffer.WriteLong(fStruct.FileSize);
            buffer.WriteString(fStruct.FileName);
            buffer.WriteString(fStruct.FileExtension);
            PacketData = buffer.ToArray();
            PacketType = "_TFR";
        }