System.IO.FileStreamEx.ReadByte C# (CSharp) Méthode

ReadByte() public méthode

Read a byte from current FileStream
public ReadByte ( ) : byte
Résultat byte
        public new byte ReadByte()
        {
            byte[] RByte = new byte[1];

            // Use read method of FileStream instead of ReadByte
            // Becuase ReadByte return a SIGNED byte as integer
            // But what we want here is unsigned byte
            base.Read(RByte, 0, 1);

            return RByte[0];
        }

Usage Example

Exemple #1
0
        /// <summary>
        /// Create new AttachedPictureFrame
        /// </summary>
        /// <param name="FrameID">4 Characters tag identifier</param>
        /// <param name="Flags">2 Bytes flags identifier</param>
        /// <param name="Data">Contain Data for this frame</param>
        /// <param name="Length">MaxLength of frame</param>
        internal AttachedPictureFrame(string FrameID, FrameFlags Flags, FileStreamEx Data, int Length)
            : base(FrameID, Flags)
        {
            _TextEncoding = (TextEncodings)Data.ReadByte();
            Length--;
            if (!IsValidEnumValue(_TextEncoding, ValidatingErrorTypes.ID3Error))
            {
                _MustDrop = true;
                return;
            }

            _MIMEType = Data.ReadText(Length, TextEncodings.Ascii, ref Length, true);

            _PictureType = (PictureTypes)Data.ReadByte();
            Length--;

            _Description = Data.ReadText(Length, _TextEncoding, ref Length, true);

            _Data = Data.ReadData(Length);
        }
All Usage Examples Of System.IO.FileStreamEx::ReadByte