-
Notifications
You must be signed in to change notification settings - Fork 0
/
IOscArgument.cs
58 lines (50 loc) · 2.13 KB
/
IOscArgument.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
namespace Suhock.Osc;
public interface IOscArgument
{
/// <summary>
/// The ASCII character that indicates this argument type in an OSC type tag string.
/// </summary>
public byte TypeTag { get; }
/// <summary>
/// </summary>
/// <returns>The number of bytes in the binary-encoded OSC message argument</returns>
int GetByteCount();
/// <summary>
/// Encodes the OSC message argument as a binary string
/// </summary>
/// <returns>A byte array containing the binary-encoded OSC message argument</returns>
byte[] GetBytes();
/// <summary>
/// Writes the binary-encoded value of the argument to a byte array.
/// </summary>
/// <param name="target">The target byte array</param>
/// <returns>The number of bytes written</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// If the length of the <c>bytes</c> is too small to fit the encoded argument
/// </exception>
int WriteBytes(byte[] target);
/// <summary>
/// Writes the binary-encoded value of the argument to a byte array starting at the specified offset.
/// </summary>
/// <param name="target">The target byte array</param>
/// <param name="startIndex">The index in the byte array at which to start writing</param>
/// <returns>The number of bytes written</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// If the length of the <c>bytes</c> starting from <c>startIndex</c> is too small to fit the encoded argument
/// </exception>
int WriteBytes(byte[] target, int startIndex);
/// <summary>
/// Writes the binary-encoded value of the argument to a <c>Span</c> of bytes.
/// </summary>
/// <param name="target">The target byte <c>Span</c></param>
/// <returns></returns>
/// <exception cref="ArgumentOutOfRangeException">
/// If the length of the <c>bytes</c> is too small to fit the encoded argument
/// </exception>
int WriteBytes(Span<byte> target);
/// <summary>
/// </summary>
/// <returns>A string representation of the argument suitable for display to a user</returns>
string ToString();
}