SwfDotNet.IO.Utils.BufferedBinaryReader.PeekByte C# (CSharp) Method

PeekByte() public method

Peeks the byte.
public PeekByte ( ) : byte
return byte
        public byte PeekByte()
        {
            byte val = ReadByte();
            base.BaseStream.Seek(-1, System.IO.SeekOrigin.Current);
            return val;
        }

Usage Example

Beispiel #1
0
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            int count = 0;

            byte fillStyleCount = binaryReader.ReadByte();
            count = System.Convert.ToInt32(fillStyleCount);
            ushort fillStyleCountExtended = 0;
            if (fillStyleCount == 0xFF && (shapeType == ShapeType.Shape2 || shapeType == ShapeType.Shape3))
            {
                fillStyleCountExtended = binaryReader.ReadUInt16();
                count = System.Convert.ToInt32(fillStyleCountExtended);
            }

            if (count != 0)
            {
                for (int i = 0; i < count; i++)
                {
                    byte fillStyleType = binaryReader.PeekByte();
                    FillStyle fillStyle = GetFillStyleFromType(fillStyleType);
                    if (fillStyle != null)
                    {
                        fillStyle.ReadData(binaryReader, shapeType);
                        this.Add(fillStyle);
                    }
                }
            }
        }
All Usage Examples Of SwfDotNet.IO.Utils.BufferedBinaryReader::PeekByte