CSJ2K.j2k.image.input.ImgReaderPPM.confirmFileType C# (CSharp) 메소드

confirmFileType() 개인적인 메소드

Checks that the file begins with 'P6'
private confirmFileType ( ) : void
리턴 void
        private void confirmFileType()
        {
            byte[] type = new byte[]{80, 54};
            int i;
            byte b;

            for (i = 0; i < 2; i++)
            {
                b = countedByteRead();
                if (b != type[i])
                {
                    if (i == 1 && b == 51)
                    {
                        // i.e 'P3'
                        throw new System.ArgumentException("JJ2000 does not support" + " ascii-PPM files. Use " + " raw-PPM file instead. ");
                    }
                    else
                    {
                        throw new System.ArgumentException("Not a raw-PPM file");
                    }
                }
            }
        }