# Poco::Data

# class BLOB

Library: Data
Package: DataCore
Header: Poco/Data/BLOB.h

## Description

Representation of a Binary Large OBject.

A BLOB can hold arbitrary binary data. The maximum size depends on the underlying database.

The BLOBInputStream and BLOBOutputStream classes provide a convenient way to access the data in a BLOB.

## Member Summary

Member Functions: appendRaw, assignRaw, begin, clear, compact, content, end, operator !=, operator =, operator ==, rawContent, size, swap

## Types

### Iterator

typedef std::vector < char >::const_iterator Iterator;

## Constructors

### BLOB

BLOB();

Creates an empty BLOB.

### BLOB

BLOB(
const std::vector < char > & content
);

Creates the BLOB, content is deep-copied.

### BLOB

BLOB(
const std::string & content
);

Creates a BLOB from a string.

### BLOB

BLOB(
const BLOB & other
);

Creates a BLOB by copying another one.

### BLOB

BLOB(
const char * const pContent,
std::size_t size
);

Creates the BLOB by deep-copying pContent.

## Destructor

### ~BLOB

~BLOB();

Destroys the BLOB.

## Member Functions

### appendRaw

void appendRaw(
const char * pChar,
std::size_t count
);

Assigns raw content to internal storage.

### assignRaw

void assignRaw(
const char * pChar,
std::size_t count
);

Assigns raw content to internal storage.

### begin

Iterator begin() const;

### clear

void clear(
bool doCompact = false
);

Clears the content of the blob. If doCompact is true, trims the excess capacity.

### compact

void compact();

Trims the internal storage excess capacity.

### content

const std::vector < char > & content() const;

Returns the content.

### end

Iterator end() const;

### operator !=

bool operator != (
const BLOB & other
) const;

Compares for inequality BLOB by value.

### operator =

BLOB & operator = (
const BLOB & other
);

Assignment operator.

### operator ==

bool operator == (
const BLOB & other
) const;

Compares for equality BLOB by value.

### rawContent

const char * rawContent() const;

Returns the raw content.

If the BLOB is empty, returns NULL.

### size

std::size_t size() const;

Returns the size of the BLOB in bytes.

### swap

void swap(
BLOB & other
);

Swaps the BLOB with another one.