Update MemoryStreamReader.cs

pull/1/head
unknown 6 years ago
parent e1827fde6e
commit 3584465844

@ -13,7 +13,7 @@ namespace ZeroLevel.Services.Serialization
public sealed class MemoryStreamReader public sealed class MemoryStreamReader
: IBinaryReader : IBinaryReader
{ {
private readonly MemoryStream _stream; private readonly Stream _stream;
public MemoryStreamReader(byte[] data) public MemoryStreamReader(byte[] data)
{ {
@ -22,6 +22,13 @@ namespace ZeroLevel.Services.Serialization
_stream = new MemoryStream(data); _stream = new MemoryStream(data);
} }
public MemoryStreamReader(Stream stream)
{
if (stream == null)
throw new ArgumentNullException(nameof(stream));
_stream = stream;
}
/// <summary> /// <summary>
/// Flag reading /// Flag reading
/// </summary> /// </summary>

Loading…
Cancel
Save

Powered by TurnKey Linux.