private void Send(TCPFileCode code, byte[] content)
        {
            using (MemoryStream ms = new MemoryStream()) {
                ms.WriteByte((byte)code);
                ms.Write(content, 0, content.Length);

                Send(new TCPMessage()
                {
                    Content = ms.ToArray()
                });
            }
        }
        /// <summary>
        /// Initializes the events
        /// </summary>
        private void InitEvents()
        {
            OnMessage += (message) => {
                TCPFileCode code = (TCPFileCode)message.Content[0];
                string      json = Encoding.UTF8.GetString(message.Content.Skip(1).ToArray());

                if (code == TCPFileCode.Enqueue)
                {
                    TCPFileTransferData data = JsonConvert.DeserializeObject <TCPFileTransferData>(json);

                    Incoming.Enqueue(new TCPFileProgress()
                    {
                        Cache        = new TCPFileCache(data.FullFileName),
                        TransferData = data
                    });

                    using (MemoryStream ms = new MemoryStream()) {
                        TCPReaderWriter.WriteNumber(ms, data.ID, false);
                        Send(TCPFileCode.Reply, ms.ToArray());
                    }
                }
            };
        }