AoMEngineLibrary.Graphics.Brg.BrgBinaryReader.ReadString C# (CSharp) Method

ReadString() public method

public ReadString ( byte terminator = 0x0 ) : string
terminator byte
return string
        public string ReadString(byte terminator = 0x0)
        {
            string filename = "";
            List<byte> fnBytes = new List<byte>();
            byte filenameByte = this.ReadByte();
            while (filenameByte != terminator)
            {
                filename += (char)filenameByte;
                fnBytes.Add(filenameByte);
                filenameByte = this.ReadByte();
            }
            return Encoding.UTF8.GetString(fnBytes.ToArray());
        }

Same methods

BrgBinaryReader::ReadString ( int length ) : string

Usage Example

Example #1
0
 public BrgHeader(BrgBinaryReader reader)
 {
     this.Magic = reader.ReadString(4);
     this.Unknown01 = reader.ReadInt32();
     this.NumMaterials = reader.ReadInt32();
     this.Unknown02 = reader.ReadInt32();
     this.NumMeshes = reader.ReadInt32();
     this.Reserved = reader.ReadInt32();
     this.Unknown03 = reader.ReadInt32();
 }
All Usage Examples Of AoMEngineLibrary.Graphics.Brg.BrgBinaryReader::ReadString