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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
declare module "ice"
{
namespace Ice
{
class ByteHelper
{
static validate(v:number):boolean;
}
class ShortHelper
{
static validate(v:number):boolean;
}
class IntHelper
{
static validate(v:number):boolean;
}
class FloatHelper
{
static validate(v:number):boolean;
}
class DoubleHelper
{
static validate(v:number):boolean;
}
class LongHelper
{
static validate(v:Long):boolean;
}
class InputStream
{
constructor();
constructor(buffer:Uint8Array);
constructor(communicator:Communicator);
constructor(communicator:Communicator, buffer:Uint8Array);
constructor(encoding:EncodingVersion);
constructor(encoding:EncodingVersion, buffer:Uint8Array);
constructor(communicator:Communicator, encoding:EncodingVersion);
constructor(communicator:Communicator, encoding:EncodingVersion, buffer:Uint8Array);
//
// This function allows this object to be reused, rather than reallocated.
//
reset():void;
clear():void;
swap(other:InputStream):void;
resetEncapsulation():void;
resize(sz:number):void;
startValue():void;
endValue(preserve:boolean):SlicedData;
startException():void;
endException(preserve:boolean):SlicedData;
startEncapsulation():EncodingVersion;
endEncapsulation():void;
skipEmptyEncapsulation():EncodingVersion;
readEncapsulation(encoding:EncodingVersion):Uint8Array;
getEncoding():EncodingVersion;
getEncapsulationSize():number;
skipEncapsulation():EncodingVersion;
startSlice():string; // Returns type ID of next slice
endSlice():void;
skipSlice():void;
readPendingValues():void;
readSize():number;
readAndCheckSeqSize(minSize:number):number;
readBlob(sz:number):Uint8Array;
readOptional(tag:number, expectedFormat:OptionalFormat):boolean;
readByte():number;
readByteSeq():Uint8Array;
readBool():boolean;
readShort():number;
readInt():number;
readLong():Ice.Long;
readFloat():number;
readDouble():number;
readString():string;
readProxy<T extends ObjectPrx>(type:new()=>T):T;
readOptionalProxy<T extends ObjectPrx>(tag:number, type:new()=>T):T|undefined;
readEnum<T>(type:new()=>T):T;
readOptionalEnum<T>(tag:number, type:new()=>T):T|undefined;
readValue<T extends Value>(cb:(value:T) => void, type:new()=>T):void;
readOptionalValue<T extends Value>(tag:number, cb:(value:T) => void, type:new()=>T):void;
throwException():void;
skip(size:number):void;
skipSize():void;
isEmpty():boolean;
expand(n:number):void;
//
// Sets the value factory manager to use when marshaling value instances. If the stream
// was initialized with a communicator, the communicator's value factory manager will
// be used by default.
//
valueFactoryManager:ValueFactoryManager;
//
// Sets the logger to use when logging trace messages. If the stream
// was initialized with a communicator, the communicator's logger will
// be used by default.
//
logger:Logger;
//
// Sets the compact ID resolver to use when unmarshaling value and exception
// instances. If the stream was initialized with a communicator, the communicator's
// resolver will be used by default.
//
compactIdResolver:(compactID:number) => string;
//
// Determines the behavior of the stream when extracting instances of Slice classes.
// A instance is "sliced" when a factory cannot be found for a Slice type ID.
// The stream's default behavior is to slice instances.
//
// If slicing is disabled and the stream encounters a Slice type ID
// during decoding for which no value factory is installed, it raises
// NoValueFactoryException.
//
sliceValues:boolean;
//
// Determines whether the stream logs messages about slicing instances of Slice values.
//
traceSlicing:boolean;
pos:number;
readonly size:number;
readonly buffer:Uint8Array;
}
class OutputStream
{
constructor(communicator?:Ice.Communicator, encoding?:EncodingVersion, buffer?:Uint8Array);
//
// This function allows this object to be reused, rather than reallocated.
//
reset():void;
clear():void;
finished():Uint8Array;
swap(other:OutputStream):void;
resetEncapsulation():void;
resize(sz:number):void;
prepareWrite():Uint8Array;
startValue(data:SlicedData):void;
endValue():void;
startException(data:SlicedData):void;
endException():void;
startEncapsulation():void;
startEncapsulation(encoding:EncodingVersion, format:FormatType):void;
endEncapsulation():void;
writeEmptyEncapsulation(encoding:EncodingVersion):void;
writeEncapsulation(buff:Uint8Array):void;
getEncoding():EncodingVersion;
startSlice(typeId:string, compactId:number, last:boolean):void;
endSlice():void;
writePendingValues():void;
writeSize(v:number):void;
startSize():number;
endSize(pos:number):void;
writeBlob(v:Uint8Array):void;
// Read/write format and tag for optionals
writeOptional(tag:number, format:OptionalFormat):void;
writeByte(v:number):void;
writeByteSeq(v:Uint8Array):void;
writeBool(v:boolean):void;
writeShort(v:number):void;
writeInt(v:number):void;
writeLong(v:Ice.Long):void;
writeFloat(v:number):void;
writeDouble(v:number):void;
writeString(v:string):void;
writeProxy(v:ObjectPrx):void;
writeOptionalProxy(tag:number, v?:ObjectPrx|undefined):void;
/// TODO use a base enum type
writeEnum(v:any):void;
writeValue(v:Ice.Value):void;
writeOptionalValue(tag:number, v?:Ice.Value|undefined):void;
writeException(e:UserException):void;
writeUserException(e:UserException):void;
isEmpty():boolean;
expand(n:number):void;
//
// Sets the encoding format for class and exception instances.
//
format:FormatType;
pos:number;
readonly size:number;
readonly buffer:Uint8Array;
}
}
}
|