private static TimeZoneInfo BuildFromStream (string id, Stream stream)
{
byte [] buffer = new byte [BUFFER_SIZE];
int length = stream.Read (buffer, 0, BUFFER_SIZE);
if (!ValidTZFile (buffer, length))
throw new InvalidTimeZoneException ("TZ file too big for the buffer");
try {
return ParseTZBuffer (id, buffer, length);
} catch (InvalidTimeZoneException) {
throw;
} catch (Exception e) {
throw new InvalidTimeZoneException ("Time zone information file contains invalid data", e);
}
}