# Class LazyResizableTypedArray<K, T>

A growable typed array.

#### Type Parameters

- K
- T extends TypedArrayLike<K>

##### Index

### Constructors

constructor

### Properties

buffer
onResized

### Accessors

isEmpty
uint8

### Methods

reset
setMinLength

## Constructors

### constructor

- new LazyResizableTypedArray<K, T extends TypedArrayLike<K>>(
  _factory: (length: number) => T,
  ): LazyResizableTypedArray<K, T>

  Constructor

  #### Type Parameters

  - K
  - T extends TypedArrayLike<K>

  #### Parameters

  - _factory: (length: number) => T

    Array creation factory. Allows us to create any kind of resizable typed array.

  #### Returns LazyResizableTypedArray<K, T>

## Properties

### buffer

buffer: T

Direct access to the Typed array. Reference may change if setMinLength is called. Therefore avoid storing a refernce to this buffer in other places.

### onResized

onResized: Observable<LazyResizableTypedArray<K, T>> = ...

Triggered after (and if) buffer has been resized when setMinLength was called.

## Accessors

### isEmpty

- get isEmpty(): boolean

  `true` if buffer is empty.

  #### Returns boolean

### uint8

- get uint8(): Uint8Array

  Uint8Array view of buffer.

  #### Returns Uint8Array

  Uint8Array wrapping buffer.

## Methods

### reset

- reset(): void

  Empties array. (buffer is set to zero sized array.)

  #### Returns void

### setMinLength

- setMinLength(minLength: number): boolean

  Sets minimum length of array. Array is only resized if `minLength` is larger than current array size.

  #### Parameters

  - minLength: number

    New minimal size of array.

  #### Returns boolean

  `true` if array was resized.