diff options
Diffstat (limited to 'src/stream.cpp')
-rw-r--r-- | src/stream.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/stream.cpp b/src/stream.cpp index 028166e..58641cc 100644 --- a/src/stream.cpp +++ b/src/stream.cpp | |||
@@ -30,6 +30,22 @@ Bu::String Bu::Stream::readLine() | |||
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | Bu::String Bu::Stream::readAll() | ||
34 | { | ||
35 | Bu::String sRet; | ||
36 | char buf[4096]; | ||
37 | |||
38 | while( !isEos() ) | ||
39 | { | ||
40 | int iRead = read( buf, 4096 ); | ||
41 | if( iRead == 0 ) | ||
42 | return sRet; | ||
43 | sRet.append( buf, iRead ); | ||
44 | } | ||
45 | |||
46 | return sRet; | ||
47 | } | ||
48 | |||
33 | Bu::size Bu::Stream::write( const Bu::String &sBuf ) | 49 | Bu::size Bu::Stream::write( const Bu::String &sBuf ) |
34 | { | 50 | { |
35 | return write( sBuf.getStr(), sBuf.getSize() ); | 51 | return write( sBuf.getStr(), sBuf.getSize() ); |