template<typename T>
class RAMSwapStream< T >
A stream with bin packing capability backed by RAM.
It contains 2 queues for duplex transfer: reading and writing queues. The duplex works by taking turns at the end of each stream as follow. First, when the buffer is empty, it is write-only. All writing is done to until depleted. Second, the "swap" is performed and the writing buffer now become reading now the writing buffer is cleared. Third, start duplexing (read from reading buffer and write to writing buffer). Last, once stream is depleted, repeat second step.
Note that the memory is immediately deallocated after each read to keep the memory requirement relatively constant.