Function
streamWriteBlock
Write a block of bytes from a buffer into a stream.
Include Headers
seqan/stream.h
Parameters
The stream object to write to. Types: StreamConcept | |
The data to write to the stream. Types: | |
The number of bytes to write to the stream. Types: |
Return Values
Examples
Copying data from a std::fstream into another std::fstream using SeqAn's stream adaption.
#include <seqan/sequence.h>
#include <seqan/stream.h>
int main()
{
std::fstream in("in.txt", std::ios::binary | std::ios::in);
std::fstream out("out.txt", std::ios::binary | std::ios::in);
seqan::CharString buffer;
resize(buffer, 1000);
while (!seqan::atEnd(in) && seqan::streamError(in) == 0)
{
int num = seqan::streamReadBlock(&buffer[0], in, length(buffer));
seqan::streamWriteBlock(out, &buffer[0], num);
}
return 0;
}
Part of Concept
See Also
SeqAn - Sequence Analysis Library - www.seqan.de