# Class BufferedStream
Adds a buffer to another stream.

Implements | StreamConcept
All Impl'd | StreamConcept
Defined in | <seqan/stream.h>
Signature | `template <typename TUnbufferedStream, TDirection> class BufferedStream;`

## Template Parameters

`TUnbufferedStream` | The type of the unbuffered stream to wrap.
`TDirection` | The stream direction, one of DirectionTags.

## Member Function Overview

- `BufferedStream::BufferedStream();, BufferedStream::BufferedStream(unbufferedStream);`
  Default constructor and construction from to-be-wrapped unbuffered stream.
- `void BufferedStream::setStream(stream);`
  Set the underlying stream to wrap.
- `void BufferedStream::setStreamBuf(streamBuf);`
  Set the stream buffer of the BufferedStream.

## Interface Function Overview

### Interface Functions Inherited From StreamConcept

- `position`
- `setPosition`
- `atEnd`
- `directionIterator`

## Interface Metafunction Overview

### Interface Metafunctions Inherited From StreamConcept

- `DirectionIterator`
- `Position`
- `Size`
- `Value`

## Member Functions Detail

### `BufferedStream::BufferedStream(); BufferedStream::BufferedStream(unbufferedStream);`

Default constructor and construction from to-be-wrapped unbuffered stream.

#### Parameters

`stream` | The to-be-wrapped stream.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `void BufferedStream::setStream(stream);`

Set the underlying stream to wrap.

#### Parameters

`stream` | The `TUnbufferedStream` to use.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

### `void BufferedStream::setStreamBuf(streamBuf);`

Set the stream buffer of the BufferedStream.

#### Parameters

`streamBuf` | The `std::basic_streambuf<>` to use.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### Dox Sources

    /*!
     * @class BufferedStream
     *
     * @implements StreamConcept
     *
     * @headerfile <seqan/stream.h>
     *
     * @brief Adds a buffer to another @link StreamConcept stream @endlink.
     *
     * @signature template <typename TUnbufferedStream, TDirection> class
     *            BufferedStream;
     *
     * @tparam TUnbufferedStream The type of the unbuffered @link StreamConcept
     *                           stream @endlink to wrap.
     * @tparam TDirection The stream direction, one of @link DirectionTags @endlink.
     *
     * @fn BufferedStream::BufferedStream
     *
     * @brief Default constructor and construction from to-be-wrapped unbuffered
     *        stream.
     *
     * @signature BufferedStream::BufferedStream();
     * @signature BufferedStream::BufferedStream(unbufferedStream);
     *
     * @param[in] stream The to-be-wrapped stream.
     *
     * @fn BufferedStream::setStreamBuf
     *
     * @brief Set the stream buffer of the BufferedStream.
     *
     * @signature void BufferedStream::setStreamBuf(streamBuf);
     *
     * @param[in] streamBuf The <tt>std::basic_streambuf&lt;&gt;</tt> to use.
     *
     * @fn BufferedStream::setStream
     *
     * @brief Set the underlying stream to wrap.
     *
     * @signature void BufferedStream::setStream(stream);
     *
     * @param[in] stream The <tt>TUnbufferedStream</tt> to use.
     */