# BinaryImageUnit

The `BinaryImageUnit` class represents a unit that contains a binary image. It inherits from the `IntermediateResultUnit` class and stores binary image data.

## Definition

*Package:* `com.dynamsoft.core.intermediate_results`

```java
class BinaryImageUnit extends IntermediateResultUnit
```

## Methods

| Method               | Description |
|----------------------|-------------|
| [`getImageData`](#getimagedata) | Gets the binary image data. |
| [`setImageData`](#setimagedata) | Sets the binary image data. |

### getImageData

Gets the binary image data.

```java
ImageData getImageData()
```

**Return value**

Returns an `ImageData` object containing the binary image data.

**See Also**

[ImageData](https://www.dynamsoft.com/capture-vision/docs/server/programming/java/api-reference/core/basic-classes/image-data.md)

### setImageData

Sets the binary image data.

```java
void setImageData(ImageData imgData) throws CoreException
```

**Parameters**

`imgData` The image data to set.

**Exceptions**

[`CoreException`](https://www.dynamsoft.com/capture-vision/docs/server/programming/java/api-reference/core/core-exception.md)

**See Also**

[ImageData](https://www.dynamsoft.com/capture-vision/docs/server/programming/java/api-reference/core/basic-classes/image-data.md)
