vrack-db
Version:
This is an In Memory database designed for storing time series (graphs).
15 lines (14 loc) • 556 B
JavaScript
;
/*
* Copyright © 2023 Boris Bobylev. All rights reserved.
* Licensed under the Apache License, Version 2.0
*/
Object.defineProperty(exports, "__esModule", { value: true });
const buffer_1 = require("buffer");
const POINT_SIZE = 8;
class DoubleStorage {
constructor(points) { this.buffer = buffer_1.Buffer.alloc(points * POINT_SIZE); }
readBuffer(index) { return this.buffer.readDoubleLE(index * POINT_SIZE); }
writeBuffer(index, value) { this.buffer.writeDoubleLE(value, index * POINT_SIZE); }
}
exports.default = DoubleStorage;