# ReadSource

Interface

Source: https://github.com/playcanvas/splat-transform/blob/b6424a5b3b929695fbaafe738a995adb1240d675/src/lib/io/read/file-system.ts#L71

Interface representing a readable data source.
Provides size information and creates streams for reading.

## Properties

### seekable

```ts
readonly seekable: boolean
```

Whether range reads are supported.
If false, read() must be called with no arguments or start=0.

### size

```ts
readonly size: number
```

The size of the source in bytes, or undefined if unknown.
For compressed sources (e.g., gzipped HTTP), this may be approximate.

## Methods

### close

```ts
close(): void
```

Release any resources held by this source.

### read

```ts
read(start?: number, end?: number): ReadStream
```

Create a stream for reading data, optionally with a byte range.

**Parameters**

- `start` (`number`, optional): Starting byte offset (inclusive), defaults to 0
- `end` (`number`, optional): Ending byte offset (exclusive), defaults to size/EOF

**Returns** [`ReadStream`](https://api.playcanvas.com/splat-transform/classes/ReadStream.md): A ReadStream for pulling data

**throws** Error if range requested on non-seekable source
