ReadRawByte() приватный Метод

Read one byte from the input.
/// the end of the stream or the current limit was reached ///
private ReadRawByte ( ) : byte
Результат byte
Пример #1
0
        public void ResetSizeCounter()
        {
            CodedInputStream input = CodedInputStream.CreateInstance(
                new SmallBlockInputStream(new byte[256], 8));

            input.SetSizeLimit(16);
            input.ReadRawBytes(16);

            Assert.Throws <InvalidProtocolBufferException>(() => input.ReadRawByte());

            input.ResetSizeCounter();
            input.ReadRawByte(); // No exception thrown.

            Assert.Throws <InvalidProtocolBufferException>(() => input.ReadRawBytes(16));
        }
Пример #2
0
        public void ResetSizeCounter()
        {
            CodedInputStream input = new CodedInputStream(
                new SmallBlockInputStream(new byte[256], 8));
            input.SetSizeLimit(16);
            input.ReadRawBytes(16);

            Assert.Throws<InvalidProtocolBufferException>(() => input.ReadRawByte());

            input.ResetSizeCounter();
            input.ReadRawByte(); // No exception thrown.

            Assert.Throws<InvalidProtocolBufferException>(() => input.ReadRawBytes(16));
        }