Interfaces
An abstract interface which when implemented provides an interface to close files/resources that were previously opened.
- close(): void
Closes the resource, "freeing" the backing file/resource.
An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously.
- read(p: Uint8Array): Promise<number | null>
Reads up to
p.byteLengthbytes intop. It resolves to the number of bytes read (0<n<=p.byteLength) and rejects if any error encountered. Even ifread()resolves ton<p.byteLength, it may use all ofpas scratch space during the call. If some data is available but notp.byteLengthbytes,read()conventionally resolves to what is available instead of waiting for more.
An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously.
- readSync(p: Uint8Array): number | null
Reads up to
p.byteLengthbytes intop. It resolves to the number of bytes read (0<n<=p.byteLength) and rejects if any error encountered. Even ifread()returnsn<p.byteLength, it may use all ofpas scratch space during the call. If some data is available but notp.byteLengthbytes,read()conventionally returns what is available instead of waiting for more.
An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.
- write(p: Uint8Array): Promise<number>
Writes
p.byteLengthbytes frompto the underlying data stream. It resolves to the number of bytes written fromp(0<=n<=p.byteLength) or reject with the error encountered that caused the write to stop early.write()must reject with a non-null error if would resolve ton<p.byteLength.write()must not modify the slice data, even temporarily.
An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously.
- writeSync(p: Uint8Array): number
Writes
p.byteLengthbytes frompto the underlying data stream. It returns the number of bytes written fromp(0<=n<=p.byteLength) and any error encountered that caused the write to stop early.writeSync()must throw a non-null error if it returnsn<p.byteLength.writeSync()must not modify the slice data, even temporarily.