Last updated

API / geotoolkit / util / stream / IReadable / IReadable

Class: IReadable

stream.IReadable.IReadable

A data stream, typical implementation include FileStream or MemoryStream.
This interface for class offers 'random' access to the underlying data without requiring to load the whole data in memory.

Interface

Hierarchy

Implemented by

Table of contents

Constructors
Methods

Contents

Constructors

new IReadable()

new IReadable()

Inherited from

IDisposable.constructor

Methods

dispose

Abstract dispose(): void

Dispose

Returns

void

Inherited from

IDisposable.dispose


getSize

Abstract getSize(): number

Returns the size of the underlying data

Returns

number

size The size


getStride

Abstract getStride(): number

Returns the stride of this stream

Returns

number

stride The stride


readChunk

Abstract readChunk(offset, length, callback): IReadable

Read a chunk of data and calls the callback when it's done.

Parameters

Name Type Description
offsetnumberThe position to start reading from
lengthnumberThe amount of bytes to read
callback(err: Error, buffer: Int8Array | Int16Array, bytesRead: number) => voidThe callback that will be called with the result

Returns

IReadable

this