예제 #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="RelationIdentifier" /> class.
        /// </summary>
        /// <param name="stringRepresentation">The underlying relation id.</param>
        public RelationIdentifier(string stringRepresentation)
        {
            StringRepresentation = stringRepresentation;

            var elements = stringRepresentation.Split(ToStringDelimiter);

            if (elements.Length != 3 && elements.Length != 4)
            {
                throw new ArgumentException($"Not a valid relation identifier: {stringRepresentation}");
            }
            OutVertexId = LongEncoding.Decode(elements[1]);
            TypeId      = LongEncoding.Decode(elements[2]);
            RelationId  = LongEncoding.Decode(elements[0]);
            if (elements.Length == 4)
            {
                InVertexId = LongEncoding.Decode(elements[3]);
            }
        }
예제 #2
0
 /// <summary>
 /// Decodes a 64-bit signed integer from the buffer and advances the buffer's position.
 /// </summary>
 /// <param name="buffer">The buffer to read.</param>
 /// <returns>A 64-bit signed integer.</returns>
 public static long?DecodeLong(ByteBuffer buffer)
 {
     return(LongEncoding.Decode(buffer, 0));
 }
예제 #3
0
 public override object DecodeObject(ByteBuffer buffer, FormatCode formatCode)
 {
     return(LongEncoding.Decode(buffer, formatCode));
 }