00001
00011 #ifndef BUFFERED_WRITER_H
00012 #define BUFFERED_WRITER_H
00013
00014 #include <basic.h>
00015 #include <btron/file.h>
00016 #include "Exception.h"
00017
00019
00022 class BufferedWriter {
00023
00024 W filedes;
00025
00026 static const int bufsize = 1024;
00027
00028 B buff[bufsize];
00029
00030 static const int bcur = 0;
00031 int blen;
00032
00033 W offset;
00034
00035 public:
00036
00038
00042 BufferedWriter(W fd)
00043 : filedes(fd), blen(0) {}
00044
00046
00052 void write(const B* target, int size);
00053
00055
00060 void flush();
00061
00062 };
00063
00064 #endif // BUFFERED_WRITER_H