public static ulong Decode(byte[] bytes) { var i = 8 - bytes.Length; var buffer = new byte[8]; Buffer.BlockCopy(bytes, 0, buffer, i, bytes.Length); buffer[i] = (byte)(buffer[i] & (255 >> 2)); return(ByteUtilities.ToUInt64(buffer)); }
public static UInt64 Decode(byte[] bytes) { int i = 8 - bytes.Length; byte[] buffer = new byte[8]; Buffer.BlockCopy(bytes, 0, buffer, i, bytes.Length); UInt64 res = ByteUtilities.ToUInt64(buffer); return(res); }
public static StreamId Decode(byte[] data) { StreamId result; UInt64 id = ByteUtilities.ToUInt64(data); UInt64 identifier = id >> 2; UInt64 type = (UInt64)(0x03 & id); StreamType streamType = (StreamType)type; result = new StreamId(identifier, streamType); return(result); }