# Class: com.pnfsoftware.jeb.util.base.TypedContent

A buffer of data with a MIME type and contents properties.

## Constructor: TypedContent
- parameter: `text`, type: `java.lang.String`
- parameter: `mimeType`, type: `java.lang.String`

Description: Create text content.
parameter: text: text content
parameter: mimeType: MIME type; defaults to [MimeType#TEXT_PLAIN](MimeType#TEXT_PLAIN) if blank

## Constructor: TypedContent
- parameter: `text`, type: `java.lang.String`
- parameter: `mimeType`, type: `java.lang.String`
- parameter: `properties`, type: `com.pnfsoftware.jeb.util.base.ITypedContentProperties`

Description: Create text content.
parameter: text: text content
parameter: mimeType: MIME type; defaults to [MimeType#TEXT_PLAIN](MimeType#TEXT_PLAIN) if blank
parameter: properties: optional content properties

## Constructor: TypedContent
- parameter: `bytes`, type: `byte[]`
- parameter: `mimeType`, type: `java.lang.String`

Description: Create binary content.
parameter: bytes: bytes
parameter: mimeType: MIME type; defaults to [MimeType#APPLICATION_OCTETSTREAM](MimeType#APPLICATION_OCTETSTREAM) if blank

## Constructor: TypedContent
- parameter: `bytes`, type: `byte[]`
- parameter: `mimeType`, type: `java.lang.String`
- parameter: `charsetName`, type: `java.lang.String`

Description: Create binary content.
parameter: bytes: bytes
parameter: mimeType: MIME type; defaults to [MimeType#APPLICATION_OCTETSTREAM](MimeType#APPLICATION_OCTETSTREAM) if blank
parameter: charsetName: optional charset name used when converting to text

## Constructor: TypedContent
- parameter: `bytes`, type: `byte[]`
- parameter: `mimeType`, type: `java.lang.String`
- parameter: `charsetName`, type: `java.lang.String`
- parameter: `properties`, type: `com.pnfsoftware.jeb.util.base.ITypedContentProperties`

Description: Create binary content.
parameter: bytes: bytes
parameter: mimeType: MIME type; defaults to [MimeType#APPLICATION_OCTETSTREAM](MimeType#APPLICATION_OCTETSTREAM) if blank
parameter: charsetName: optional charset name used when converting to text
parameter: properties: optional content properties

## Method: getBytes
- return type: `byte[]`

Description: Get this content as bytes.
return: bytes, encoding text with the configured charset if needed

## Method: getCharsetName
- return type: `java.lang.String`

Description: 
return: charset name, or null to use the default charset

## Method: getMimeType
- return type: `java.lang.String`

Description: 
return: MIME type

## Method: getProperties
- return type: `com.pnfsoftware.jeb.util.base.ITypedContentProperties`

Description: 
return: optional content properties

## Method: getText
- return type: `java.lang.String`

Description: Get this content as text.
return: text, decoding bytes with the configured charset if needed

## Method: isBinary
- return type: `boolean`

Description: 
return: true if this instance was created from bytes

## Method: isText
- return type: `boolean`

Description: 
return: true if this instance was created from text

## Static Method: bytes
- parameter: `bytes`, type: `byte[]`
- return type: `com.pnfsoftware.jeb.util.base.TypedContent`

Description: Create binary typed content.
parameter: bytes: bytes
return: typed content

## Static Method: html
- parameter: `text`, type: `java.lang.String`
- parameter: `anchor`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.util.base.TypedContent`

Description: Create HTML typed content with an optional anchor.
parameter: text: HTML text
parameter: anchor: optional anchor to associate with the content
return: typed content

## Static Method: html
- parameter: `text`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.util.base.TypedContent`

Description: Create HTML typed content.
parameter: text: HTML text
return: typed content

## Static Method: text
- parameter: `text`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.util.base.TypedContent`

Description: Create plain\-text typed content.
parameter: text: text
return: typed content

