Exemplo n.º 1
0
        private void writeMessage(byte[] buffer1)
        {
            ByteArrayOutputStream stream = new ByteArrayOutputStream();

            if ((buffer1.Length / 4) >= 0x7f)
            {
                int num = buffer1.Length / 4;
                StreamingUtils.writeByte(0x7f, stream);
                StreamingUtils.writeByte((int)(num & 0xff), stream);
                StreamingUtils.writeByte((int)((num >> 8) & 0xff), stream);
                StreamingUtils.writeByte((int)((num >> 0x10) & 0xff), stream);
            }
            else
            {
                StreamingUtils.writeByte((int)(buffer1.Length / 4), stream);
            }
            StreamingUtils.writeByteArray(buffer1, stream);
            byte[] buffer = stream.toByteArray();
            this.socket.getOutputStream().write(buffer, 0, buffer.Length);
            this.socket.getOutputStream().flush();
        }