|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file. 1 #ifndef SPONGE_LIBSPONGE_BYTE_STREAM_HH
2 #define SPONGE_LIBSPONGE_BYTE_STREAM_HH
85 #endif // SPONGE_LIBSPONGE_BYTE_STREAM_HH
size_t bytes_written() const
Total number of bytes written.
void pop_output(const size_t len)
Remove bytes from the buffer.
void end_input()
Signal that the byte stream has reached its ending.
void set_error()
Indicate that the stream suffered an error.
size_t buffer_size() const
std::string read(const size_t len)
std::string peek_output(const size_t len) const
size_t bytes_read() const
Total number of bytes popped.
ByteStream(const size_t capacity)
Construct a stream with room for capacity bytes.
size_t write(const std::string &data)
bool buffer_empty() const
size_t remaining_capacity() const
bool _error
Flag indicating that the stream suffered an error.