/// <summary> /// Decodes a byte from the given data array into header information. /// </summary> /// <param name="data"></param> /// <param name="startIndex"></param> /// <returns></returns> public static Header Decode(byte[] data, int startIndex) { if (startIndex > data.Length) { throw new ArgumentOutOfRangeException("startIndex"); } return(HeaderConvertor.Decode(data[startIndex])); }
/// <summary> /// Decodes the given byte into header information. /// </summary> /// <param name="data"></param> /// <returns></returns> private static Header Decode(byte data) { return(new Header() { ArF1 = (data & (1 << 6)) != 0, IsPoint = (data & (1 << 5)) != 0, ArF0 = (data & (1 << 4)) != 0, HasAttributes = (data & (1 << 3)) != 0, Version = HeaderConvertor.DecodeVersion(data) }); }