NodeBufferStore
DBPF.js v1.1.0 • Docs
DBPF.js v1.1.0 / BufferStore / NodeBufferStore
Class: NodeBufferStore
A buffer store for Node.js environments.
Remarks
This class is designed to work with both Blobs/File objects and file paths.
Extends
BaseBufferStore
Constructors
new NodeBufferStore()
new NodeBufferStore(
file,segment_options):NodeBufferStore
Parameters
• file: string | Blob | File
The Blob/File object or file path to read from.
• segment_options: Partial<SegmentOptions> = {}
Returns
See
SegmentOptions
Overrides
BaseBufferStore.constructor
Defined in
Properties
_blob
private_blob:undefined|Blob|File
The file property for the Node.js backing store, if it is a Blob or File object.
Defined in
/ _direct
protectedreadonly_direct:BufferStoreDirect
The Node.js implementation of the direct buffer getter for retrieving buffer segments directly from the file system.
See
BaseBufferStore._direct
Param
The offset in the buffer to start reading from.
Param
The length of the buffer to read.
Overrides
BaseBufferStore._direct
Defined in
/ _path
private_path:undefined|string
The file property for the Node.js backing store, if it is a file path.
Defined in
count
readonlycount:number
The number of segments in the cache.
Inherited from
BaseBufferStore.count
Defined in
length
readonlylength:number
The length of the file in bytes.
Inherited from
BaseBufferStore.length
Defined in
segment / _size
readonlysegment_size:number
The size of each segment in bytes.
Inherited from
BaseBufferStore.segment_size
Defined in
Accessors
_file
setprotected_file(file):void
The setter for the file property.
See
BaseBufferStore._file
Parameters
• file: string | Blob | File
Overrides
BaseBufferStore._file
Defined in
Methods
_read()
protected_read(index):Promise<BufferStoreEntry>
The Node.js implementation of the cache fallthrough method for retrieving non-cached buffer segments.
Parameters
• index: number
The index of the buffer segment to read from the file system.
Returns
Promise<BufferStoreEntry>
See
BaseBufferStore._read
Overrides
BaseBufferStore._read
Defined in
get()
get(
offset,length):BufferReader
Retrieves a buffer by its offset and length and wraps it in a BufferReader.
Parameters
• offset: number
• length: number
Returns
BufferReader
Inherited from
BaseBufferStore.get