MsgPack.UnpackingStream Class Reference

Represents raw binary as read only Stream. More...

Inherits Stream.

Public Member Functions

sealed override int Read (byte[] buffer, int offset, int count)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. More...
 
sealed override void Flush ()
 Overrides M:Stream.Flush() so that no action is performed. More...
 
sealed override void SetLength (long value)
 Throws NotSupportedException. More...
 
sealed override void Write (byte[] buffer, int offset, int count)
 Throws NotSupportedException. More...
 

Properties

sealed override bool CanRead [get]
 Gets a value indicating whether the current stream supports reading. More...
 
sealed override bool CanWrite [get]
 Gets a value indicating whether the current stream supports writing. More...
 
sealed override long Length [get]
 Gets the length in bytes of the stream. More...
 
sealed override bool CanTimeout [get]
 Gets a value that determines whether the current stream can time out. More...
 

Detailed Description

Represents raw binary as read only Stream.

This object behaves as wrapper of the underlying Stream which contains message pack encoded byte array. But, this object does not own the stream, so that stream is not closed when this stream is closed.

The value of M:Stream.CanSeek, timeout, and async API depends on the underlying stream.

Member Function Documentation

◆ Flush()

sealed override void MsgPack.UnpackingStream.Flush ( )

Overrides M:Stream.Flush() so that no action is performed.

◆ Read()

sealed override int MsgPack.UnpackingStream.Read ( byte[]  buffer,
int  offset,
int  count 
)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters
bufferAn array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and ( offset + count - 1) replaced by the bytes read from the current source.
offsetThe zero-based byte offset in buffer at which to begin storing the data read from the current stream.
countThe maximum number of bytes to be read from the current stream.
Returns
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
Exceptions
T:System.ArgumentExceptionThe sum of offset and count is larger than the buffer length.
T:System.ArgumentNullExceptionbuffer is null.
T:System.ArgumentOutOfRangeExceptionoffset or count is negative.
T:System.IO.IOExceptionAn I/O error occurs.
T:System.ObjectDisposedExceptionMethods were called after the stream was closed.

<note> Arguments might be passed to the underlying Stream without any validation. </note>

◆ SetLength()

sealed override void MsgPack.UnpackingStream.SetLength ( long  value)

Throws NotSupportedException.

Parameters
valueNever used.
Exceptions
T:System.NotSupportedExceptionAlways thrown.

◆ Write()

sealed override void MsgPack.UnpackingStream.Write ( byte[]  buffer,
int  offset,
int  count 
)

Throws NotSupportedException.

Parameters
bufferNever used.
offsetNever used.
countNever used.
Exceptions
T:System.NotSupportedExceptionAlways thrown.

Property Documentation

◆ CanRead

sealed override bool MsgPack.UnpackingStream.CanRead
get

Gets a value indicating whether the current stream supports reading.

Always true.

◆ CanTimeout

sealed override bool MsgPack.UnpackingStream.CanTimeout
get

Gets a value that determines whether the current stream can time out.

A value that determines whether the current stream can time out.

Exceptions
T:System.ObjectDisposedExceptionMethods were called after the stream was closed.

◆ CanWrite

sealed override bool MsgPack.UnpackingStream.CanWrite
get

Gets a value indicating whether the current stream supports writing.

Always false.

◆ Length

sealed override long MsgPack.UnpackingStream.Length
get

Gets the length in bytes of the stream.

A long value representing the length of the raw binary length. This value must be between 0 and Int32.MaxValue.

Exceptions
T:System.ObjectDisposedExceptionMethods were called after the stream was closed.

This property never throws NotSupportedException even if M:Stream.CanSeek is false.


The documentation for this class was generated from the following file:
  • MsgPackSources/UnpackingStream.cs