-
Notifications
You must be signed in to change notification settings - Fork 2k
/
IBinaryTokenStreamWriter.cs
133 lines (95 loc) · 4.97 KB
/
IBinaryTokenStreamWriter.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
using System;
using System.Collections.Generic;
using System.Net;
using Orleans.Runtime;
namespace Orleans.Serialization
{
public interface IBinaryTokenStreamWriter
{
/// <summary> Current write position in the stream. </summary>
int CurrentOffset { get; }
/// <summary> Write an <c>Int32</c> value to the stream. </summary>
void Write(int i);
/// <summary> Write an <c>Int16</c> value to the stream. </summary>
void Write(short s);
/// <summary> Write an <c>Int64</c> value to the stream. </summary>
void Write(long l);
/// <summary> Write a <c>sbyte</c> value to the stream. </summary>
void Write(sbyte b);
/// <summary> Write a <c>UInt32</c> value to the stream. </summary>
void Write(uint u);
/// <summary> Write a <c>UInt16</c> value to the stream. </summary>
void Write(ushort u);
/// <summary> Write a <c>UInt64</c> value to the stream. </summary>
void Write(ulong u);
/// <summary> Write a <c>byte</c> value to the stream. </summary>
void Write(byte b);
/// <summary> Write a <c>float</c> value to the stream. </summary>
void Write(float f);
/// <summary> Write a <c>double</c> value to the stream. </summary>
void Write(double d);
/// <summary> Write a <c>decimal</c> value to the stream. </summary>
void Write(decimal d);
/// <summary> Write a <c>string</c> value to the stream. </summary>
void Write(string s);
/// <summary> Write a <c>char</c> value to the stream. </summary>
void Write(char c);
/// <summary> Write a <c>bool</c> value to the stream. </summary>
void Write(bool b);
/// <summary> Write a <c>null</c> value to the stream. </summary>
void WriteNull();
/// <summary> Write a type header for the specified Type to the stream. </summary>
/// <param name="t">Type to write header for.</param>
/// <param name="expected">Currently expected Type for this stream.</param>
void WriteTypeHeader(Type t, Type expected = null);
/// <summary> Write a <c>byte[]</c> value to the stream. </summary>
void Write(byte[] b);
/// <summary> Write a list of byte array segments to the stream. </summary>
void Write(List<ArraySegment<byte>> bytes);
/// <summary> Write the specified number of bytes to the stream, starting at the specified offset in the input <c>byte[]</c>. </summary>
/// <param name="b">The input data to be written.</param>
/// <param name="offset">The offset into the inout byte[] to start writing bytes from.</param>
/// <param name="count">The number of bytes to be written.</param>
void Write(byte[] b, int offset, int count);
/// <summary> Write a <c>Int16[]</c> value to the stream. </summary>
void Write(short[] i);
/// <summary> Write a <c>Int32[]</c> value to the stream. </summary>
void Write(int[] i);
/// <summary> Write a <c>Int64[]</c> value to the stream. </summary>
void Write(long[] l);
/// <summary> Write a <c>UInt16[]</c> value to the stream. </summary>
void Write(ushort[] i);
/// <summary> Write a <c>UInt32[]</c> value to the stream. </summary>
void Write(uint[] i);
/// <summary> Write a <c>UInt64[]</c> value to the stream. </summary>
void Write(ulong[] l);
/// <summary> Write a <c>sbyte[]</c> value to the stream. </summary>
void Write(sbyte[] l);
/// <summary> Write a <c>char[]</c> value to the stream. </summary>
void Write(char[] l);
/// <summary> Write a <c>bool[]</c> value to the stream. </summary>
void Write(bool[] l);
/// <summary> Write a <c>double[]</c> value to the stream. </summary>
void Write(double[] d);
/// <summary> Write a <c>float[]</c> value to the stream. </summary>
void Write(float[] f);
/// <summary> Write a <c>IPEndPoint</c> value to the stream. </summary>
void Write(IPEndPoint ep);
/// <summary> Write a <c>IPAddress</c> value to the stream. </summary>
void Write(IPAddress ip);
/// <summary> Write a <c>SiloAddress</c> value to the stream. </summary>
void Write(SiloAddress addr);
/// <summary> Write a <c>TimeSpan</c> value to the stream. </summary>
void Write(TimeSpan ts);
/// <summary> Write a <c>DataTime</c> value to the stream. </summary>
void Write(DateTime dt);
/// <summary> Write a <c>Guid</c> value to the stream. </summary>
void Write(Guid id);
/// <summary>
/// Try to write a simple type (non-array) value to the stream.
/// </summary>
/// <param name="obj">Input object to be written to the output stream.</param>
/// <returns>Returns <c>true</c> if the value was successfully written to the output stream.</returns>
bool TryWriteSimpleObject(object obj);
}
}