public RegistryTimeZoneInformation(byte[] bytes) { if ((bytes == null) || (bytes.Length != 0x2c)) { throw new ArgumentException("Invalid REG_TZI_FORMAT"); } this.Bias = LittleEndianConverter.ToInt32(bytes, 0); this.StandardBias = LittleEndianConverter.ToInt32(bytes, 4); this.DaylightBias = LittleEndianConverter.ToInt32(bytes, 8); this.StandardDate = new SystemTime(bytes, 12); this.DaylightDate = new SystemTime(bytes, 28); }
public static int ReadInt32(Stream stream) { byte[] buffer = new byte[4]; stream.Read(buffer, 0, 4); return(LittleEndianConverter.ToInt32(buffer, 0)); }
public static int ReadInt32(byte[] buffer, ref int offset) { offset += 4; return(LittleEndianConverter.ToInt32(buffer, offset - 4)); }