Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function encodeGeneralArray(dataType, stream, value) {
const arr = value || [];
assert(arr instanceof Array);
assert(_.isFinite(arr.length));
ec.encodeUInt32(arr.length, stream);
const encode = get_encoder(dataType);
let i;
const n = arr.length;
for (i = 0; i < n; i++) {
encode(arr[i], stream);
}
}
public encode(stream: OutputBinaryStream): void {
super.encode(stream);
encodeUInt32(this.protocolVersion, stream);
encodeUInt32(this.receiveBufferSize, stream);
encodeUInt32(this.sendBufferSize, stream);
encodeUInt32(this.maxMessageSize, stream);
encodeUInt32(this.maxChunkCount, stream);
encodeUAString(this.endpointUrl, stream);
}
function encodeGeneralArray(dataType: DataType, stream: OutputBinaryStream, value: any) {
const arr = value || [];
assert(arr instanceof Array);
assert(_.isFinite(arr.length));
encodeUInt32(arr.length, stream);
const encode = get_encoder(dataType);
let i;
const n = arr.length;
for (i = 0; i < n; i++) {
encode(arr[i], stream);
}
}
public encode(stream: OutputBinaryStream): void {
super.encode(stream);
encodeUInt32(this.protocolVersion, stream);
encodeUInt32(this.receiveBufferSize, stream);
encodeUInt32(this.sendBufferSize, stream);
encodeUInt32(this.maxMessageSize, stream);
encodeUInt32(this.maxChunkCount, stream);
}
public encode(stream: OutputBinaryStream): void {
super.encode(stream);
encodeUInt32(this.protocolVersion, stream);
encodeUInt32(this.receiveBufferSize, stream);
encodeUInt32(this.sendBufferSize, stream);
encodeUInt32(this.maxMessageSize, stream);
encodeUInt32(this.maxChunkCount, stream);
}
public encode(stream: OutputBinaryStream): void {
super.encode(stream);
encodeUInt32(this.protocolVersion, stream);
encodeUInt32(this.receiveBufferSize, stream);
encodeUInt32(this.sendBufferSize, stream);
encodeUInt32(this.maxMessageSize, stream);
encodeUInt32(this.maxChunkCount, stream);
}
public encode(stream: OutputBinaryStream): void {
super.encode(stream);
encodeUInt32(this.sequenceNumber, stream);
encodeUInt32(this.requestId, stream);
}