Exemple #1
0
        public void MatchSegment_ValidHeaderAndType()
        {
            var segment = new JpegSegment(JpegSegmentType.App1, new byte[]
            {
                (byte)'T', (byte)'e', (byte)'s', (byte)'t', 0x00, 0x12, 0x34
            }, 0);

            Assert.IsTrue(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, "Test\0"));
        }
Exemple #2
0
        private static bool IsAttributeSegment(JpegSegment segment)
        {
            const string header = AttributeReader.JpegSegmentHeader;

            return(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, header));
        }
Exemple #3
0
        public void MatchSegment_ShortHeader()
        {
            var segment = new JpegSegment(JpegSegmentType.App1, new byte[0], 0);

            Assert.IsFalse(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, "Test\0"));
        }
Exemple #4
0
        public void MatchSegment_InvalidType()
        {
            var segment = new JpegSegment(JpegSegmentType.App0, new byte[0], 0);

            Assert.IsFalse(JpegSegmentUtils.MatchSegment(segment, JpegSegmentType.App1, "Test\0"));
        }