本文整理汇总了TypeScript中node-opcua-binary-stream.OutputBinaryStream.writeInteger方法的典型用法代码示例。如果您正苦于以下问题:TypeScript OutputBinaryStream.writeInteger方法的具体用法?TypeScript OutputBinaryStream.writeInteger怎么用?TypeScript OutputBinaryStream.writeInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类node-opcua-binary-stream.OutputBinaryStream
的用法示例。
在下文中一共展示了OutputBinaryStream.writeInteger方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: encodeHighAccuracyDateTime
export function encodeHighAccuracyDateTime(date: Date | null, picoseconds: number, stream: OutputBinaryStream) {
if (date === null) {
stream.writeUInt32(0);
stream.writeUInt32(picoseconds % 100000);
return;
}
if (!(date instanceof Date)) {
throw new Error("Expecting a Date : but got a " + typeof(date) + " " + (date as any).toString());
}
assert(date instanceof Date);
const hl = bn_dateToHundredNanoSecondFrom1601(date, picoseconds);
const hi = hl[0];
const lo = hl[1];
stream.writeInteger(lo);
stream.writeInteger(hi);
}
示例2: _encode_enumeration
function _encode_enumeration(value: EnumItem, stream: OutputBinaryStream): void {
stream.writeInteger(value.value);
}
示例3: encodeInt32
export function encodeInt32(value: Int32, stream: OutputBinaryStream): void {
assert(_.isFinite(value));
stream.writeInteger(value);
}