本文整理匯總了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);
}