Example #1
0
        // Token: 0x06003504 RID: 13572 RVA: 0x001332AC File Offset: 0x001316AC
        public static bool TryReadLengthPrefix(byte[] buffer, int index, int count, PrefixStyle style, out int length)
        {
            bool result;

            using (Stream stream = new MemoryStream(buffer, index, count))
            {
                result = Serializer.TryReadLengthPrefix(stream, style, out length);
            }
            return(result);
        }
        public static bool TryReadLengthPrefix(byte[] buffer, int index, int count, PrefixStyle style, out int length)
        {
            bool flag;

            using (Stream memoryStream = new MemoryStream(buffer, index, count))
            {
                flag = Serializer.TryReadLengthPrefix(memoryStream, style, out length);
            }
            return(flag);
        }
Example #3
0
        public static bool TryReadLengthPrefix(Stream source, out int length)
        {
            long pos = source.Position;

            // Заголовок сообщения находится в самом начале.
            source.Position = 0;

            bool success = ProtoBufSerializer.TryReadLengthPrefix(source, HeaderLengthPrefix, out length);

            source.Position = pos;

            return(success);
        }