Remove BinaryReader from XccGlobalDatabase.

This commit is contained in:
Paul Chote
2016-04-01 17:21:50 +01:00
parent 728bad9565
commit bf61785f96

View File

@@ -20,22 +20,21 @@ namespace OpenRA.FileFormats
public XccGlobalDatabase(Stream s)
{
var entries = new List<string>();
var reader = new BinaryReader(s);
while (reader.PeekChar() > -1)
while (s.Peek() > -1)
{
var count = reader.ReadInt32();
var count = s.ReadInt32();
for (var i = 0; i < count; i++)
{
var chars = new List<char>();
char c;
byte c;
// Read filename
while ((c = reader.ReadChar()) != 0)
chars.Add(c);
while ((c = s.ReadUInt8()) != 0)
chars.Add((char)c);
entries.Add(new string(chars.ToArray()));
// Skip comment
while ((c = reader.ReadChar()) != 0) { }
while ((c = s.ReadUInt8()) != 0) { }
}
}