/// <summary> /// Writes a binary representation of this class to a byte buffer, at a given position. /// The position is incremented to the end of the representation /// </summary> /// <param name="buffer">a byte array where the binary represenaion is written</param> /// <param name="position">the position in the byte array</param> public void ToByteArray(byte[] buffer, ref int position) { Ratings.ToByteArray(buffer, ref position); Boundaries.ToByteArray(buffer, ref position); QueryIds.ToByteArray(buffer, ref position); DocIds.ToByteArray(buffer, ref position); MaxDcg.ToByteArray(buffer, ref position); DocToQuery.ToByteArray(buffer, ref position); }
/// <summary> /// Returns the number of bytes written by the member ToByteArray() /// </summary> public int SizeInBytes() { return(Ratings.SizeInBytes() + Boundaries.SizeInBytes() + QueryIds.SizeInBytes() + DocIds.SizeInBytes() + MaxDcg.SizeInBytes() + DocToQuery.SizeInBytes()); }