Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public encode(stream: OutputBinaryStream): void {
// call base class implementation first
super.encode(stream);
encodeUInt16(this.namespaceIndex, stream);
encodeUAString(this.name, stream);
}
}
// write statusCode
if (check_flag(encoding_mask, DataValueEncodingByte.StatusCode)) {
//ec.encodeUInt32(dataValue.statusCode.value,stream);
ec.encodeStatusCode(dataValue.statusCode,stream);
}
// write sourceTimestamp
if (check_flag(encoding_mask, DataValueEncodingByte.SourceTimestamp)) {
ec.encodeHighAccuracyDateTime(dataValue.sourceTimestamp,dataValue.sourcePicoseconds,stream);
}
// write sourcePicoseconds
if (check_flag(encoding_mask, DataValueEncodingByte.SourcePicoseconds)) {
assert(dataValue.sourcePicoseconds != null );
const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) /10);
ec.encodeUInt16(sourcePicoseconds,stream);
}
// write serverTimestamp
if (check_flag(encoding_mask, DataValueEncodingByte.ServerTimestamp)) {
ec.encodeHighAccuracyDateTime(dataValue.serverTimestamp,dataValue.serverPicoseconds,stream);
}
// write serverPicoseconds
if (check_flag(encoding_mask, DataValueEncodingByte.ServerPicoseconds)) {
assert(dataValue.serverPicoseconds != null);
const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000 ) / 10) ; // we encode 10-pios
ec.encodeUInt16(serverPicoseconds,stream);
}
},
decode_debug: function(dataValue,stream,options) {
}
dataValue.value.encode(stream);
}
// write statusCode
if (encodingMask & DataValueEncodingByte.StatusCode) {
encodeStatusCode(dataValue.statusCode, stream);
}
// write sourceTimestamp
if ((encodingMask & DataValueEncodingByte.SourceTimestamp) && (dataValue.sourceTimestamp !== null)) {
encodeHighAccuracyDateTime(dataValue.sourceTimestamp, dataValue.sourcePicoseconds, stream);
}
// write sourcePicoseconds
if (encodingMask & DataValueEncodingByte.SourcePicoseconds) {
assert(dataValue.sourcePicoseconds !== null);
const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) / 10);
encodeUInt16(sourcePicoseconds, stream);
}
// write serverTimestamp
if ((encodingMask & DataValueEncodingByte.ServerTimestamp) && dataValue.serverTimestamp !== null) {
encodeHighAccuracyDateTime(dataValue.serverTimestamp, dataValue.serverPicoseconds, stream);
}
// write serverPicoseconds
if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
assert(dataValue.serverPicoseconds !== null);
const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000) / 10); // we encode 10-pios
encodeUInt16(serverPicoseconds, stream);
}
}
}
// write sourcePicoseconds
if (check_flag(encoding_mask, DataValueEncodingByte.SourcePicoseconds)) {
assert(dataValue.sourcePicoseconds != null );
const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) /10);
ec.encodeUInt16(sourcePicoseconds,stream);
}
// write serverTimestamp
if (check_flag(encoding_mask, DataValueEncodingByte.ServerTimestamp)) {
ec.encodeHighAccuracyDateTime(dataValue.serverTimestamp,dataValue.serverPicoseconds,stream);
}
// write serverPicoseconds
if (check_flag(encoding_mask, DataValueEncodingByte.ServerPicoseconds)) {
assert(dataValue.serverPicoseconds != null);
const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000 ) / 10) ; // we encode 10-pios
ec.encodeUInt16(serverPicoseconds,stream);
}
},
decode_debug: function(dataValue,stream,options) {
}
// write sourcePicoseconds
if (encodingMask & DataValueEncodingByte.SourcePicoseconds) {
assert(dataValue.sourcePicoseconds !== null);
const sourcePicoseconds = Math.floor((dataValue.sourcePicoseconds % 100000) / 10);
encodeUInt16(sourcePicoseconds, stream);
}
// write serverTimestamp
if ((encodingMask & DataValueEncodingByte.ServerTimestamp) && dataValue.serverTimestamp !== null) {
encodeHighAccuracyDateTime(dataValue.serverTimestamp, dataValue.serverPicoseconds, stream);
}
// write serverPicoseconds
if (encodingMask & DataValueEncodingByte.ServerPicoseconds) {
assert(dataValue.serverPicoseconds !== null);
const serverPicoseconds = Math.floor((dataValue.serverPicoseconds % 100000) / 10); // we encode 10-pios
encodeUInt16(serverPicoseconds, stream);
}
}