* Writes a Date, long millis since epoch, to a buffer starting from offset. * @param {Date} date * @param {Buffer} buffer * @param {Number} offset * @return {Number} The new offset. * @private
(date, buffer, offset)
| 249 | * @private |
| 250 | */ |
| 251 | function writeDate(date, buffer, offset) { |
| 252 | const long = Long.fromNumber(date.getTime()); |
| 253 | buffer.writeUInt32BE(long.getHighBitsUnsigned(), offset); |
| 254 | buffer.writeUInt32BE(long.getLowBitsUnsigned(), offset + 4); |
| 255 | return offset + 8; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Reads a Date, long millis since epoch, from a buffer starting from offset. |
no test coverage detected