Class Unpackager
Responsible for converting binary data to recordings for playback.
Inheritance
Inherited Members
Namespace: RecordAndPlay.IO
Assembly: RecordAndPlay.dll
Syntax
public static class Unpackager
Methods
FromTransport(RepeatedField<CustomEventCapture>)
Declaration
public static CustomEventCapture[] FromTransport(RepeatedField<CustomEventCapture> transportCapture)
Parameters
| Type | Name | Description |
|---|---|---|
| Google.Protobuf.Collections.RepeatedField<CustomEventCapture> | transportCapture |
Returns
| Type | Description |
|---|---|
| CustomEventCapture[] |
FromTransport(Recording[])
Converts protobuf recordings into a version that can be used for playback.
Declaration
public static Recording[] FromTransport(params Recording[] transportRecordings)
Parameters
| Type | Name | Description |
|---|---|---|
| Recording[] | transportRecordings | Protobuf recordings to be converted. |
Returns
| Type | Description |
|---|---|
| Recording[] | Recordings that can be used for things like playback. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the recordings presented is null or empty. |
GetRecordingsFromFile(String)
Attempts to load recording(s) from the file at the path specified.
Declaration
public static Recording[] GetRecordingsFromFile(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | The path to the file containing the recording(s). |
Returns
| Type | Description |
|---|---|
| Recording[] | Recordings found in the file specified. |
Peak(Stream)
Look at how many recording files are in the stream without reading the entire stream. Should only progress the stream by 5 bytes. That might not always be the case in future versions though. You'll need to reset the stream if you expect to feed the same stream into Unpackage.
Declaration
public static int Peak(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The stream containing the recoring data. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The number of recordings in the stream. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the stream is null or empty. |
| System.SystemException | Thrown when the stream contains data in an unexpected format. |
Unpackage(Stream)
Reads from a stream of data and builds an array of recordings that can be used for playback.
Declaration
public static Recording[] Unpackage(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The stream to be read from for building Recording objects. |
Returns
| Type | Description |
|---|---|
| Recording[] |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when the stream is null or empty. |
| System.SystemException | Thrown when the stream contains data in an unexpected format. |