Exemplo n.º 1
0
        public void ReadCharStringStdShort()
        {
            // The buffer contains the string "OiGroup" and trailing null bytes.
            byte[] streamData =
            {
                79, 105, 71, 114, 111, 117, 112, 0, 0, 0, 0, 0, 0
            };

            WangStream stream = new WangStream(streamData);
            string     read   = WangAnnotationStructureReader.ReadCharString(stream, streamData.Length);

            Assert.AreEqual("OiGroup", read);
            Assert.AreEqual(0, stream.AvailableBytes());
        }
Exemplo n.º 2
0
        public void ReadCharStringReadOversize()
        {
            // The buffer contains the string "OiGroup" and no null bytes.
            byte[] streamData =
            {
                79, 105, 71, 114, 111, 117, 112, 112
            };

            WangStream stream = new WangStream(streamData);
            string     read   = WangAnnotationStructureReader.ReadCharString(stream, 7);

            Assert.AreEqual("OiGroup", read);
            Assert.AreEqual(1, stream.AvailableBytes());
        }