GetAsByteStream() private méthode

private GetAsByteStream ( ) : MemoryStream
Résultat System.IO.MemoryStream
Exemple #1
0
        public override void ParseFromRaw(ChunkRaw c)
        {
            if (c.Length != 13)
            {
                throw new PngjException("Bad IDHR len " + c.Length.ToString());
            }
            MemoryStream asByteStream = c.GetAsByteStream();

            Cols       = PngHelperInternal.ReadInt4(asByteStream);
            Rows       = PngHelperInternal.ReadInt4(asByteStream);
            Bitspc     = PngHelperInternal.ReadByte(asByteStream);
            Colormodel = PngHelperInternal.ReadByte(asByteStream);
            Compmeth   = PngHelperInternal.ReadByte(asByteStream);
            Filmeth    = PngHelperInternal.ReadByte(asByteStream);
            Interlaced = PngHelperInternal.ReadByte(asByteStream);
        }
Exemple #2
0
        public override void ParseFromRaw(ChunkRaw c)
        {
            if (c.Length != 13)
            {
                throw new PngjException("Bad IDHR len " + c.Length);
            }
            MemoryStream st = c.GetAsByteStream();

            Cols = Hjg.Pngcs.PngHelperInternal.ReadInt4(st);
            Rows = Hjg.Pngcs.PngHelperInternal.ReadInt4(st);
            // bit depth: number of bits per channel
            Bitspc     = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Colormodel = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Compmeth   = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Filmeth    = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Interlaced = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
        }
Exemple #3
0
        public override void ParseFromRaw(ChunkRaw c)
        {
            if (c is null)
            {
                throw new System.ArgumentNullException(nameof(c));
            }

            if (c.Len != 13)
            {
                throw new PngjException("Bad IDHR len " + c.Len.ToString(CultureInfo.CurrentCulture));
            }

            using var st = c.GetAsByteStream();
            Cols         = Hjg.Pngcs.PngHelperInternal.ReadInt4(st);
            Rows         = Hjg.Pngcs.PngHelperInternal.ReadInt4(st);
            // bit depth: number of bits per channel
            Bitspc     = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Colormodel = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Compmeth   = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Filmeth    = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
            Interlaced = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
        }
Exemple #4
0
 public override void ParseFromRaw(ChunkRaw c)
 {
     if (c.Length != 13)
         throw new PngjException("Bad IDHR len " + c.Length);
     MemoryStream st = c.GetAsByteStream();
     Cols = Hjg.Pngcs.PngHelperInternal.ReadInt4(st);
     Rows = Hjg.Pngcs.PngHelperInternal.ReadInt4(st);
     // bit depth: number of bits per channel
     Bitspc = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
     Colormodel = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
     Compmeth = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
     Filmeth = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
     Interlaced = Hjg.Pngcs.PngHelperInternal.ReadByte(st);
 }