public bool Inflate(Stream source)
{
// Check if inflation is complete
if (_inflationOffset < Size)
{
// Calculate remaining bytes
int packetHeaderLeft = Size - _inflationOffset;
// Read the rest of the packet header
int packetHeaderRead = source.Read(_data, _inflationOffset, packetHeaderLeft);
// Update offset
_inflationOffset += (ushort)packetHeaderRead;
}
// Tell caller if inflation is complete
return _inflationOffset >= Size;
}
}