/// <summary> /// Converts an array of 5-bit integers back into an array of 8-bit integers /// removing extra zeroes left from padding if necessary. /// Throws a ValidationError if input is not a zero-padded array of 8-bit integers /// </summary> /// <param name="data"></param> /// <returns></returns> public static byte[] FromByte5Array(byte[] data) { return(ConvertBits.Convert(data, 5, 8, true)); }
/// <summary> /// Converts an array of 8-bit integers into an array of 5-bit integers, right-padding with zeroes if necessary /// </summary> /// <param name="data"></param> /// <returns></returns> public static byte[] ToByte5Array(byte[] data) { return(ConvertBits.Convert(data, 8, 5)); }