System.TimeZoneInfo.BuildFromStream C# (CSharp) Method

BuildFromStream() private static method

private static BuildFromStream ( string id, System.Stream stream ) : TimeZoneInfo
id string
stream System.Stream
return TimeZoneInfo
		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);
			}
		}