public override void EncodeObject(object value, bool arrayEncoding, ByteBuffer buffer) { if (arrayEncoding) { AmqpBitConverter.WriteLong(buffer, (long)value); } else { LongEncoding.Encode((long)value, buffer); } }
/// <summary> /// Initializes a new instance of the <see cref="RelationIdentifier" /> class. /// </summary> /// <param name="outVertexId"></param> /// <param name="typeId"></param> /// <param name="relationId"></param> /// <param name="inVertexId"></param> public RelationIdentifier(long outVertexId, long typeId, long relationId, long inVertexId) { OutVertexId = outVertexId; TypeId = typeId; RelationId = relationId; InVertexId = inVertexId; var sb = new StringBuilder(); sb.Append(LongEncoding.Encode(relationId)).Append(ToStringDelimiter) .Append(LongEncoding.Encode(outVertexId)).Append(ToStringDelimiter).Append(LongEncoding.Encode(typeId)); if (inVertexId != 0) { sb.Append(ToStringDelimiter).Append(LongEncoding.Encode(inVertexId)); } StringRepresentation = sb.ToString(); }
/// <summary> /// Encodes a 64-bit signed integer and appends the bytes to the buffer. /// </summary> /// <param name="data">The 64-bit signed integer.</param> /// <param name="buffer">The destination buffer.</param> public static void EncodeLong(long?data, ByteBuffer buffer) { LongEncoding.Encode(data, buffer); }