| Function streamWriteBlock Write a block of bytes from a buffer into a stream. streamWriteBlock(stream, source, count) Include Headers seqan/stream.h Parameters
stream | The stream object to write to. Types: StreamConcept
source | The data to write to the stream. Types: char *
count | The number of bytes to write to the stream. Types: size_t
Return Values int with the number of successfully written objects. 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 streamWriteChar, streamPut SeqAn - Sequence Analysis Library - www.seqan.de

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