GetAsByteStream() private method

private GetAsByteStream ( ) : MemoryStream
return System.IO.MemoryStream
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
 }