Class ByteInputStream
An buffer of bytes that can be read sequentially.
Inheritance
System.Object
ByteInputStream
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class ByteInputStream
Constructors
ByteInputStream(Byte[])
Initializes a new instance of the ByteInputStream class.
Declaration
public ByteInputStream(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
ByteInputStream(Byte[], Int32)
Initializes a new instance of the ByteInputStream class.
Declaration
public ByteInputStream(byte[] bytes, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | The bytes. |
System.Int32 | offset | The offset. |
Properties
Available
Gets the number of available bytes for reading.
Declaration
public int Available { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Mark()
Marks the current position for a later reset.
Declaration
public void Mark()
Read()
Reads a value from the byte array.
Declaration
public int Read()
Returns
Type | Description |
---|---|
System.Int32 | The byte, or -1 if no more bytes are available for reading. |
Read(Byte[], Int32, Int32)
Reads a segment from the byte array.
Declaration
public int Read(byte[] buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | |
System.Int32 | offset | |
System.Int32 | length |
Returns
Type | Description |
---|---|
System.Int32 | The number of bytes read. |
Reset()
Resets the stream to the marked position.
Declaration
public void Reset()
Skip(Int32)
Advances the stream position by the amount specified.
Declaration
public int Skip(int n)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | n | The number of bytes to skip. |
Returns
Type | Description |
---|---|
System.Int32 | The number of bytes skipped. |