PHP 8.2.30
Preview: buffer-reader.js Size: 1.60 KB
/home/byroehnu/.trash/node_modules11/pg-protocol/dist/buffer-reader.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BufferReader = void 0;
const emptyBuffer = Buffer.allocUnsafe(0);
class BufferReader {
    constructor(offset = 0) {
        this.offset = offset;
        this.buffer = emptyBuffer;
        // TODO(bmc): support non-utf8 encoding?
        this.encoding = 'utf-8';
    }
    setBuffer(offset, buffer) {
        this.offset = offset;
        this.buffer = buffer;
    }
    int16() {
        const result = this.buffer.readInt16BE(this.offset);
        this.offset += 2;
        return result;
    }
    byte() {
        const result = this.buffer[this.offset];
        this.offset++;
        return result;
    }
    int32() {
        const result = this.buffer.readInt32BE(this.offset);
        this.offset += 4;
        return result;
    }
    uint32() {
        const result = this.buffer.readUInt32BE(this.offset);
        this.offset += 4;
        return result;
    }
    string(length) {
        const result = this.buffer.toString(this.encoding, this.offset, this.offset + length);
        this.offset += length;
        return result;
    }
    cstring() {
        const start = this.offset;
        let end = start;
        // eslint-disable-next-line no-empty
        while (this.buffer[end++] !== 0) { }
        this.offset = end;
        return this.buffer.toString(this.encoding, start, end - 1);
    }
    bytes(length) {
        const result = this.buffer.slice(this.offset, this.offset + length);
        this.offset += length;
        return result;
    }
}
exports.BufferReader = BufferReader;
//# sourceMappingURL=buffer-reader.js.map

Directory Contents

Dirs: 0 × Files: 27

Name Size Perms Modified Actions
11 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
636 B lrw-r--r-- 2026-02-03 15:06:12
Edit Download
792 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
396 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
1.60 KB lrw-r--r-- 2026-02-03 15:06:14
Edit Download
1.71 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
441 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
2.71 KB lrw-r--r-- 2026-02-03 15:06:14
Edit Download
3.01 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
11 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
19.06 KB lrw-r--r-- 2026-02-03 15:06:14
Edit Download
14.59 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
302 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
791 B lrw-r--r-- 2026-02-03 15:06:14
Edit Download
522 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
5.96 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
4.86 KB lrw-r--r-- 2026-02-03 15:06:16
Edit Download
3.30 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
11 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
10.81 KB lrw-r--r-- 2026-02-03 15:06:16
Edit Download
10.04 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
669 B lrw-r--r-- 2026-02-03 15:06:18
Edit Download
13.13 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
10.23 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
1.24 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
6.77 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download
6.96 KB lrw-r--r-- 2026-02-03 15:06:18
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).