public void SendCompressed(int header, byte[] data, int offset, int size) { int length2 = LZ4.Encode(data, offset, m_sendBuffer, 8, size, 65528); BitConverter.TryWriteBytes(new Span <byte>(m_sendBuffer, 4, 4), length2); BitConverter.TryWriteBytes(new Span <byte>(m_sendBuffer, 0, 4), header); m_socket.Send(m_sendBuffer, length2 + 8, SocketFlags.None); }