コード例 #1
0
ファイル: CryptoDtoDeserializer.cs プロジェクト: macaba/GeoVR
        public static Deserializer Deserialise(IBufferWriter <byte> plaintextBuffer, CryptoDtoChannelStore channelStore, ReadOnlyMemory <byte> bytes)
        {
            var header  = Deserializer.GetHeader(bytes, out ushort headerLength);
            var channel = channelStore.GetChannel(header.ChannelTag);

            return(new Deserializer(channel, headerLength, header, bytes.Span, false, plaintextBuffer));
        }
コード例 #2
0
ファイル: CryptoDtoDeserializer.cs プロジェクト: macaba/GeoVR
        public static Deserializer DeserializeIgnoreSequence(IBufferWriter <byte> plaintextBuffer, CryptoDtoChannelStore channelStore, ReadOnlyMemory <byte> bytes)  //This is used for UDP channels where duplication is possible and the overhead of CryptographicException isn't acceptable. Use IsSequenceValid() in code to ignore the UDP packet.
        {
            var header  = Deserializer.GetHeader(bytes, out ushort headerLength);
            var channel = channelStore.GetChannel(header.ChannelTag);

            return(new Deserializer(channel, headerLength, header, bytes.Span, true, plaintextBuffer));
        }
コード例 #3
0
ファイル: CryptoDtoDeserializer.cs プロジェクト: macaba/GeoVR
        public static Deserializer DeserializeIgnoreSequence(CryptoDtoChannelStore channelStore, ReadOnlyMemory <byte> bytes)  //This is used for UDP channels where duplication is possible and the overhead of CryptographicException isn't acceptable. Use IsSequenceValid() in code to ignore the UDP packet.
        {
            var plaintextBuffer = new ArrayBufferWriter <byte>();

            return(DeserializeIgnoreSequence(plaintextBuffer, channelStore, bytes));
        }
コード例 #4
0
ファイル: CryptoDtoDeserializer.cs プロジェクト: macaba/GeoVR
        public static Deserializer Deserialize(CryptoDtoChannelStore channelStore, ReadOnlyMemory <byte> bytes)
        {
            var plaintextBuffer = new ArrayBufferWriter <byte>();

            return(Deserialise(plaintextBuffer, channelStore, bytes));
        }
コード例 #5
0
        // Hint for callers using ArrayBufferWriter<byte> - output.WrittenSpan contains the serialised data
        public void Serialize <T>(IBufferWriter <byte> output, CryptoDtoChannelStore channelStore, string channelTag, CryptoDtoMode mode, T obj)
        {
            var channel = channelStore.GetChannel(channelTag);

            Serialize(output, channel, mode, obj);
        }
コード例 #6
0
        public byte[] Serialize <T>(CryptoDtoChannelStore channelStore, string channelTag, CryptoDtoMode mode, T obj)
        {
            var channel = channelStore.GetChannel(channelTag);

            return(Serialize(channel, mode, obj));
        }