# EmbeddedFileStream

## Content

# Class: EmbeddedFileStream

Represents embedded file stream in PDF.

## Extends

- [`ObjectBase`](ObjectBase)

## Constructors

### Constructor

```ts
new EmbeddedFileStream(om, bytes): EmbeddedFileStream;
```

Initialize a new instance of the EmbeddedFileStream class.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

[ObjectManager](ObjectManager) that controls the lifetime of the EmbeddedFileStream.

##### bytes

`Uint8Array`

The file data.

#### Returns

`EmbeddedFileStream`

#### Overrides

```ts
ObjectBase.constructor
```

### Constructor

```ts
new EmbeddedFileStream(bytes): EmbeddedFileStream;
```

Initialize a new instance of the EmbeddedFileStream class.

#### Parameters

##### bytes

`Uint8Array`

The file data.

#### Returns

`EmbeddedFileStream`

#### Overrides

```ts
ObjectBase.constructor
```

## Accessors

### checkSum

#### Get Signature

```ts
get checkSum(): Uint8Array<ArrayBufferLike>;
```

Gets or sets a 16-byte string that is the checksum of the bytes of the uncompressed embedded file.
The checksum is calculated by applying the standard MD5 message-digest algorithm
to the bytes of the embedded file stream.
Checksum calculated automatically when EmbeddedFileStream is created.

##### Returns

`Uint8Array`&lt;`ArrayBufferLike`&gt;

#### Set Signature

```ts
set checkSum(value): void;
```

Gets or sets a 16-byte string that is the checksum of the bytes of the uncompressed embedded file.
The checksum is calculated by applying the standard MD5 message-digest algorithm
to the bytes of the embedded file stream.
Checksum calculated automatically when EmbeddedFileStream is created.

##### Parameters

###### value

`Uint8Array`&lt;`ArrayBufferLike`&gt;

##### Returns

`void`

***

### creationDate

#### Get Signature

```ts
get creationDate(): PdfDateTime;
```

Gets or sets the date and time when the embedded file was created.

##### Returns

[`PdfDateTime`](../type-aliases/PdfDateTime)

#### Set Signature

```ts
set creationDate(value): void;
```

Gets or sets the date and time when the embedded file was created.

##### Parameters

###### value

[`PdfDateTime`](../type-aliases/PdfDateTime)

##### Returns

`void`

***

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`ObjectBase`](ObjectBase).[`id`](ObjectBase#id)

***

### mimeType

#### Get Signature

```ts
get mimeType(): string;
```

Gets or sets the file's MIME type.

##### Returns

`string`

#### Set Signature

```ts
set mimeType(value): void;
```

Gets or sets the file's MIME type.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### modificationDate

#### Get Signature

```ts
get modificationDate(): PdfDateTime;
```

Gets or sets the date and time when the embedded file was last modified.

##### Returns

[`PdfDateTime`](../type-aliases/PdfDateTime)

#### Set Signature

```ts
set modificationDate(value): void;
```

Gets or sets the date and time when the embedded file was last modified.

##### Parameters

###### value

[`PdfDateTime`](../type-aliases/PdfDateTime)

##### Returns

`void`

***

### om

#### Get Signature

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ObjectBase`](ObjectBase).[`om`](ObjectBase#om)

***

### size

#### Get Signature

```ts
get size(): number;
```

Gets or sets the size of the embedded file, in bytes.

##### Returns

`number`

#### Set Signature

```ts
set size(value): void;
```

Gets or sets the size of the embedded file, in bytes.

##### Parameters

###### value

`number`

##### Returns

`void`

## Methods

### free()

```ts
free(): void;
```

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`free`](ObjectBase#free)

***

### getStream()

```ts
getStream(): Uint8Array<ArrayBufferLike>;
```

Gets the Uint8Array containing content of this EmbeddedFileStream,
stream should be disposed after usage.
NOTE! Method can return null if this EmbeddedFileStream is empty.

#### Returns

`Uint8Array`&lt;`ArrayBufferLike`&gt;

***

### rebind()

```ts
rebind(omTo): void;
```

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`rebind`](ObjectBase#rebind)
