# Poco

# template < typename ch, typename tr, typename ba = BufferAllocator < ch >>

# class BasicBufferedBidirectionalStreamBuf

Library: Foundation
Package: Streams
Header: Poco/BufferedBidirectionalStreamBuf.h

## Description

This is an implementation of a buffered bidirectional streambuf that greatly simplifies the implementation of custom streambufs of various kinds. Derived classes only have to override the methods readFromDevice() or writeToDevice().

In contrast to BasicBufferedStreambuf, this class supports simultaneous read and write access, so in addition to istream and ostream this streambuf can also be used for implementing an iostream.

## Inheritance

Direct Base Classes: std::basic_streambuf < ch, tr >

All Base Classes: std::basic_streambuf < ch, tr >

## Member Summary

Member Functions: getMode, operator =, overflow, resetBuffers, resizeBuffer, setMode, sync, underflow

## Types Aliases

### Allocator

using Allocator = ba;

### Base

using Base = std::basic_streambuf < ch, tr >;

### IOS

using IOS = std::basic_ios < ch, tr >;

### char_traits

using char_traits = tr;

### char_type

using char_type = ch;

### int_type

using int_type = typename Base::int_type;

### off_type

using off_type = typename Base::off_type;

### openmode

using openmode = typename IOS::openmode;

### pos_type

using pos_type = typename Base::pos_type;

## Constructors

### BasicBufferedBidirectionalStreamBuf

BasicBufferedBidirectionalStreamBuf(
const BasicBufferedBidirectionalStreamBuf & param206
) = delete;

### BasicBufferedBidirectionalStreamBuf

BasicBufferedBidirectionalStreamBuf(
std::streamsize bufferSize,
openmode mode
);

## Destructor

### ~BasicBufferedBidirectionalStreamBuf

~BasicBufferedBidirectionalStreamBuf() override;

## Member Functions

### operator =

BasicBufferedBidirectionalStreamBuf & operator = (
const BasicBufferedBidirectionalStreamBuf & param207
) = delete;

### overflow

int_type overflow(
int_type c
) override;

### sync

int sync() override;

### underflow

int_type underflow() override;

### getMode

openmode getMode() const;

### resetBuffers

void resetBuffers();

### resizeBuffer

virtual bool resizeBuffer(
std::streamsize bufferSize
);

### setMode

void setMode(
openmode mode
);