Class BufferedReader
A buffered reader for a Stream
Implements
Inherited Members
Namespace: VoltRpc.IO
Assembly: VoltRpc.dll
Syntax
public class BufferedReader : IDisposable
Constructors
| Edit this page View SourceBufferedReader(Stream, int)
Creates a new BufferedReader instance
Declaration
public BufferedReader(Stream incoming, int bufferSize = 8000)
Parameters
Type | Name | Description |
---|---|---|
Stream | incoming | |
int | bufferSize |
Fields
| Edit this page View SourceIncomingStream
The incoming Stream
Declaration
protected readonly Stream IncomingStream
Field Value
Type | Description |
---|---|
Stream |
Properties
| Edit this page View SourceHasDisposed
Has this object been disposed
Declaration
public bool HasDisposed { get; }
Property Value
Type | Description |
---|---|
bool |
IncomingStreamNeedToAdjustPosition
You may need to override this if your Stream requires it
Declaration
protected virtual bool IncomingStreamNeedToAdjustPosition { get; }
Property Value
Type | Description |
---|---|
bool |
IncomingStreamPosition
You may need to override this if your Stream requires it
Declaration
protected virtual long IncomingStreamPosition { get; set; }
Property Value
Type | Description |
---|---|
long |
Length
The length of the buffer
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
int |
Position
The current position of the buffer
Declaration
public int Position { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceDispose()
Disposes of this BufferedReader instance
This method SHOULD NOT be used! VoltRpc will dispose of this object when it is done with it!
NOTE: This disposal method will NOT call Dispose() on the underlying IncomingStream
Declaration
public void Dispose()
~BufferedReader()
Destructor for this object
Declaration
protected ~BufferedReader()
ReadByte()
Reads a byte
Declaration
public byte ReadByte()
Returns
Type | Description |
---|---|
byte |
Exceptions
Type | Condition |
---|---|
EndOfStreamException |
ReadBytesSegment(int)
Reads an array of bytes as an ArraySegment<T>
Declaration
public ArraySegment<byte> ReadBytesSegment(int count)
Parameters
Type | Name | Description |
---|---|---|
int | count |
Returns
Type | Description |
---|---|
ArraySegment<byte> |
Exceptions
Type | Condition |
---|---|
EndOfStreamException |
ReadString()
Reads a string
Declaration
public string ReadString()
Returns
Type | Description |
---|---|
string |
Exceptions
Type | Condition |
---|---|
EndOfStreamException |