# OneNoteBinaryPayload

Lazily materialized binary data associated with a OneNote image, file, recording, or ink object.

Class 

`OfficeIMO.OneNote`

**Namespace**

`OfficeIMO.OneNote`

**Assembly**

`OfficeIMO.OneNote`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OneNoteBinaryContent.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteBinaryContent.cs#L32)

**Modifiers**

sealed

Lazily materialized binary data associated with a OneNote image, file, recording, or ink object.

## Inheritance

- object
- OneNoteBinaryPayload

## Usage

Explore 12 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 12

- Property [OneNoteBinaryElement.Payload](/api/onenote/officeimo-onenote-onenotebinaryelement/#property-payload)
- Method [OneNoteBinaryPayload.FromBytes](/api/onenote/officeimo-onenote-onenotebinarypayload/#method-frombytes-byte)
- Method [OneNoteBinaryPayload.FromStreamFactory](/api/onenote/officeimo-onenote-onenotebinarypayload/#method-fromstreamfactory-func-system-io-stream-nullable-system-int64)
- Property [OneNoteEmbeddedFile.Payload](/api/onenote/officeimo-onenote-onenoteembeddedfile/#property-payload)
- Property [OneNoteFileDataStoreObject.Payload](/api/onenote/officeimo-onenote-onenotefiledatastoreobject/#property-payload)
- Property [OneNoteFileNode.EncodedData](/api/onenote/officeimo-onenote-onenotefilenode/#property-encodeddata)
- Property [OneNoteImage.Payload](/api/onenote/officeimo-onenote-onenoteimage/#property-payload)
- Property [OneNoteInk.Payload](/api/onenote/officeimo-onenote-onenoteink/#property-payload)
- Property [OneNoteMath.RawPayload](/api/onenote/officeimo-onenote-onenotemath/#property-rawpayload)
- Property [OneNoteMedia.Payload](/api/onenote/officeimo-onenote-onenotemedia/#property-payload)
- Property [OneNotePropertyValue.Data](/api/onenote/officeimo-onenote-onenotepropertyvalue/#property-data)
- Property [OneNoteRevisionStoreObject.RawPropertyData](/api/onenote/officeimo-onenote-onenoterevisionstoreobject/#property-rawpropertydata)

Filter members 

Show inherited

## Methods

`public static OneNoteBinaryPayload FromBytes(byte[] bytes)` [#](#method-frombytes-byte)

[OneNoteBinaryContent.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteBinaryContent.cs#L32)

Creates an independently owned payload by copying a byte array.

Parameters

**bytes byte[] required**

Returns

`OneNoteBinaryPayload`

`public static OneNoteBinaryPayload FromStreamFactory(Func<Stream> streamFactory, long? length = null)` [#](#method-fromstreamfactory-func-system-io-stream-nullable-system-int64)

[OneNoteBinaryContent.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteBinaryContent.cs#L54)

Creates a lazy payload. The factory must return a new readable stream for every call.

Parameters

**streamFactory System.Func<System.IO.Stream> required**

**length long? = null optional**

Returns

`OneNoteBinaryPayload`

`public Stream OpenRead()` [#](#method-openread)

[OneNoteBinaryContent.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteBinaryContent.cs#L61)

Opens a new readable stream for the payload.

Returns

`Stream`

`public byte[] ToArray(long maxBytes)` [#](#method-toarray-int64)

[OneNoteBinaryContent.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteBinaryContent.cs#L81)

Materializes a defensive copy of the payload with a caller-provided size bound.

Parameters

**maxBytes long required**

Returns

`byte[]`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public long? Length { get; }` [#](#property-length)

[OneNoteBinaryContent.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteBinaryContent.cs#L28)

Payload length when known without opening the stream.

<!-- PowerForge markdown artifact sha256:7D19E274601E211A71DEB40ED6F453127642A3F5F3AADC70214A71921186C40F -->
