// <summary> /// Decode an array of unsigned longs into a ZigZag encoded array of signed longs. /// </summary> /// <param name="values"></param> /// <returns></returns> public static Int64[] Decode(UInt64[] values) { var output = new Int64[values.Length]; for (var i = 0; i < values.Length; i++) { output[i] = ZigZag.Decode(values[i]); } return(output); }
public IEnumerable <Int64> DecompressSigned(Stream input, Int32 count) { #if DEBUG if (null == input) { throw new ArgumentNullException(nameof(input)); } if (count < 0) { throw new ArgumentOutOfRangeException(nameof(count)); } #endif return(DecompressUnsigned(input, count).Select(symbol => ZigZag.Decode(symbol))); }
/// <summary> /// Read the next value. /// </summary> /// <returns></returns> public Int64 Read() { return(ZigZag.Decode(Underlying.Read())); }