ParseFrom<T> for array slice is missing

This commit is contained in:
Jan Tattermusch 2017-11-09 18:33:15 +01:00
parent 07542e78da
commit 30b6e54327

View File

@ -208,6 +208,20 @@ namespace Google.Protobuf
return message; return message;
} }
/// <summary>
/// Parses a message from a byte array slice.
/// </summary>
/// <param name="data">The byte array containing the message. Must not be null.</param>
/// <param name="offset">The offset of the slice to parse.</param>
/// <param name="length">The length of the slice to parse.</param>
/// <returns>The newly parsed message.</returns>
public new T ParseFrom(byte[] data, int offset, int length)
{
T message = factory();
message.MergeFrom(data, offset, length);
return message;
}
/// <summary> /// <summary>
/// Parses a message from the given byte string. /// Parses a message from the given byte string.
/// </summary> /// </summary>