class

  StringReader

classdesc

  A string helper used to read given string as bytes.2 chars as one byte.

param

  The string to read.

### Hierarchy

- StringReader

## Index

### Constructors

- constructor

### Properties

- pos
- size
- str

### Methods

- isEmpty
- read
- readInt
- readLong
- readNextBytes
- readNextLen
- readNullTerminated
- readUint16
- readUint32
- readUint8
- unreadBytes

## Constructors

### constructor

- new StringReader(str?: string): StringReader

- - Defined in utils.ts:223

  #### Parameters

  - ##### Default value str: string = ""

  #### Returns StringReader

## Properties

### pos

pos: number

- Defined in utils.ts:222

### size

size: number

- Defined in utils.ts:223

### str

str: string

- Defined in utils.ts:221

## Methods

### isEmpty

- isEmpty(): boolean

- - Defined in utils.ts:236

  Checks if reached the end of the string.

  #### Returns boolean

### read

- read(bytes: number): string

- - Defined in utils.ts:244

  Reads some bytes.

  #### Parameters

  - ##### bytes: number

    Number of bytes to read

  #### Returns string

### readInt

- readInt(): number

- - Defined in utils.ts:329

  Read 4 bytes as int in littleEndian

  #### Returns number

### readLong

- readLong(): number

- - Defined in utils.ts:336

  Read 8 bytes as long in littleEndian

  #### Returns number

### readNextBytes

- readNextBytes(): string

- - Defined in utils.ts:278

  First, read one byte as the length of bytes to read. Then read the following bytes.

  #### Returns string

### readNextLen

- readNextLen(): number

- - Defined in utils.ts:291

  Reads one byte as int, which may indicates the length of following bytes to read.

  #### Returns number

### readNullTerminated

- readNullTerminated(): string

- - Defined in utils.ts:264

  Reads string terminated by NULL.

  #### Returns string

### readUint16

- readUint16(): number

- - Defined in utils.ts:315

  read 2 bytes as uint16 in littleEndian

  #### Returns number

### readUint32

- readUint32(): number

- - Defined in utils.ts:322

  Read 4 bytes as uint32 in littleEndian

  #### Returns number

### readUint8

- readUint8(): number

- - Defined in utils.ts:308

  Read Uint8

  #### Returns number

### unreadBytes

- unreadBytes(bytes: number): void

- - Defined in utils.ts:253

  #### Parameters

  - ##### bytes: number

  #### Returns void

Generated using TypeDoc