diffusion
Version:
Diffusion JavaScript client
69 lines (68 loc) • 3.13 kB
JavaScript
;
/**
* @module Services.LogRetrieval
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.EntriesFetchResponseSerialiser = exports.EntriesFetchResponseSerialiserClass = void 0;
var Codec = require("./../../io/codec");
var serialiser_1 = require("./../../serialisers/serialiser");
var entries_fetch_response_1 = require("./entries-fetch-response");
/**
* Serialiser for {@link EntriesFetchResponse}
*/
var EntriesFetchResponseSerialiserClass = /** @class */ (function (_super) {
__extends(EntriesFetchResponseSerialiserClass, _super);
function EntriesFetchResponseSerialiserClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Read a {@link EntriesFetchResponse} from the stream
*
* @param bis the input stream
* @return the {@link EntriesFetchResponse} that was read
*/
EntriesFetchResponseSerialiserClass.prototype.read = function (bis) {
var firstEntry = Codec.readInt64(bis);
var entryCount = Codec.readInt64(bis);
var maxEntriesAvailable = Codec.readInt64(bis);
var firstLineNumber = Codec.readInt64(bis);
var entries = Codec.readBytes(bis);
var fileId = Codec.readInt64(bis);
return new entries_fetch_response_1.EntriesFetchResponse(firstEntry, entryCount, fileId, maxEntriesAvailable, firstLineNumber, entries);
};
/**
* Write a {@link EntriesFetchResponse} to the stream
*
* @param bos the output stream
* @param value the {@link EntriesFetchResponse} to be written
*/
EntriesFetchResponseSerialiserClass.prototype.write = function (bos, value) {
Codec.writeInt64(bos, value.firstEntry);
Codec.writeInt64(bos, value.entryCount);
Codec.writeInt64(bos, value.maxEntriesAvailable);
Codec.writeInt64(bos, value.firstLineNumber);
Codec.writeBytes(bos, value.entries);
Codec.writeInt64(bos, value.fileId);
};
return EntriesFetchResponseSerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.EntriesFetchResponseSerialiserClass = EntriesFetchResponseSerialiserClass;
/**
* The {@link EntriesFetchResponseSerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.EntriesFetchResponseSerialiser = new EntriesFetchResponseSerialiserClass();