Esempio n. 1
0
        public void WriteTo(ObjectWriter writer)
        {
            writer.WriteInt32(_checkSum.Length);

            for (var i = 0; i < _checkSum.Length; i++)
            {
                writer.WriteByte(_checkSum[i]);
            }
        }
Esempio n. 2
0
        public static Checksum Create(WellKnownSynchronizationKind kind, ImmutableArray <byte> bytes)
        {
            using var stream = SerializableBytes.CreateWritableStream();
            using var writer = new ObjectWriter(stream);
            writer.WriteInt32((int)kind);

            for (var i = 0; i < bytes.Length; i++)
            {
                writer.WriteByte(bytes[i]);
            }

            return(Create(stream));
        }
Esempio n. 3
0
        public static Checksum Create(string kind, ImmutableArray <byte> bytes)
        {
            using (var stream = SerializableBytes.CreateWritableStream())
                using (var writer = new ObjectWriter(stream))
                {
                    writer.WriteString(kind);

                    for (var i = 0; i < bytes.Length; i++)
                    {
                        writer.WriteByte(bytes[i]);
                    }

                    return(Create(stream));
                }
        }