# com.bea.content
BinaryValue Class

public class BinaryValue
extends `Object`
implements `Serializable`

This class represents binary content. It contains the binary data along with binary metadata.

A BinaryValue must always contain the contentType, name and size. If the bytes are not present (they are not contained on when retrieving a Property for performance reasons), they can be retrieved through NodeOps for Property bytes and ObjectClassOps for PropertyChoice bytes. A size of -1, means it is not available.

After using a BinaryValue, it is necessary to close the value InputStream.

Hierarchy
  `Object`
  `BinaryValue`

All Implemented Interfaces
  `Serializable`

## Constructor Summary

BinaryValue() Constructs an empty BinaryValue.
BinaryValue(`String` contentType, `String` name, int size, `InputStream` value) Constructs a full BinaryValue.
BinaryValue(`String` contentType, `String` name, int size) Constructs a BinaryValue without the bytes.

## Method Summary

`public `String`` | `getContentType`() Gets the content type for the binary data.
`public `String`` | `getName`() Gets the filename for the binary data, including the file extension.
`public int` | `getSize`() Returns the size in bytes.
`public `InputStream`` | `getValue`() Gets the binary data.
`public void` | `setContentType`(`String` contentType) Sets the content type for the binary data.
`public void` | `setName`(`String` name) Sets the filename for the binary data, including the file extension.
`public void` | `setSize`(int size) Sets the size in bytes.
`public void` | `setValue`(`InputStream` value) Sets the binary data.
`public `String`` | `toString`() Returns the BinaryValue's name as a String.

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Detail

### BinaryValue

    public BinaryValue()

  Constructs an empty BinaryValue.

### BinaryValue

    public BinaryValue(String contentType,
                       String name,
                       int size,
                       InputStream value)

  Constructs a full BinaryValue.

### BinaryValue

    public BinaryValue(String contentType,
                       String name,
                       int size)

  Constructs a BinaryValue without the bytes.

## Method Detail

### getContentType() Method

    public String getContentType()

Gets the content type for the binary data. For example, "mimetypevalue;charset=charsetvalue"

### getName() Method

    public String getName()

Gets the filename for the binary data, including the file extension. For example, foo.html

### getSize() Method

    public int getSize()

Returns the size in bytes.

### getValue() Method

    public InputStream getValue()

Gets the binary data. After using the value, it is necessary to close the InputStream.

### setContentType(String) Method

    public void setContentType(String contentType)

Sets the content type for the binary data. For example, "mimetypevalue;charset=charsetvalue".

### setName(String) Method

    public void setName(String name)

Sets the filename for the binary data, including the file extension. For example, foo.html

### setSize(int) Method

    public void setSize(int size)

Sets the size in bytes.

### setValue(InputStream) Method

    public void setValue(InputStream value)

Sets the binary data.

### toString() Method

    public String toString()

Returns the BinaryValue's name as a String.

Overrides
  `Object.toString()`