Core/ByteBuffer: Implemented ReadXorByte, usefull when reading guid bytes based on bits

This commit is contained in:
Rat committed 2012-01-20 14:25:46 +01:00
1 parent 166a161f35
commit 7749359269
1 file changed
+13
+13
View File
@@ -194,6 +194,19 @@ class ByteBuffer
b ^= read<uint8>();
}
uint8 ReadXorByte()
{
return ReadUInt8() ^ 1;
}
void ReadXorByte(uint32 bit, uint8& byte)
{
if (!bit)
byte = 0;
else
byte = ReadUInt8() ^ bit;
}
void WriteByteMask(uint8 b)
{
WriteBit(b);