// Fills the given byte buffer from start position, and returns length public static int LongToBytes(long value, byte[] buffer, int start = 0) { var zz = encodeZigZag(value, 64); return(UVarInt.ULongToBytes((ulong)zz, buffer, start)); }
public static long BytesToLong(byte[] data, ref int position) { var zz = UVarInt.BytesToULong(data, ref position); return(decodeZigZag(zz)); }