Function
streamReadBlock
Read a block of bytes into a buffer.
streamReadBlock(target, stream, maxLen)
Include Headers
seqan/stream.h
Parameters

target | The buffer to read into. There has to be enough space for maxLen bytes. Types: char *
stream | The stream to read from. Types: StreamConcept
maxLen | maximal number of characters to read. Types: size_t

Return Values
Number of read bytes.
Examples
Copying data from a std::fstream into another std::fstream using SeqAn's stream adaption.
#include <fstream>
#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
StreamConcept
See Also
streamReadChar, streamPeek
SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2014/10/13 16:12:59