Ejemplo n.º 1
0
        public static byte[] GetPacketData(byte[] data)
        {
            var eof    = GetEncoding.GetBytes(DEF_EOF);
            var packet = new byte[data.Length + eof.Length];

            Array.Copy(data, 0, packet, 0, data.Length);
            Array.Copy(eof, 0, packet, data.Length, eof.Length);
            return(packet);
        }
Ejemplo n.º 2
0
        private void WriteWithoutCache(HttpContext context)
        {
            GZipOutputStream gzipStream = new GZipOutputStream(context.Response.OutputStream);

            byte[] buff = GetEncoding.GetBytes(_content.ToCharArray());
            gzipStream.Write(buff, 0, buff.Length);
            gzipStream.Flush();
            gzipStream.Close();
        }
Ejemplo n.º 3
0
 public static byte[] GetPacketData(string data)
 {
     return(GetEncoding.GetBytes(data + DEF_EOF));
 }