#include <AbstractInputStream.h>
Public Member Functions | |
const sk::util::Class | getClass () const |
Returns the object's class. | |
virtual int | read (char *buffer, int offset, int length)=0 |
Reads up to lenght bytes of data from the input stream into an array of bytes starting from offset. | |
char | read () |
Reads the next byte of data from the input stream. | |
std::vector< char > | read (int number) |
Reads up to number bytes of data from the input stream and returns them as a vector of chars. | |
std::vector< char > & | read (std::vector< char > &buffer, int number) |
Reads up to number bytes of data from the input stream into the specified vector of chars. The vector size will be adjusted depending on the actual amount of date read. Returns a reference to the same vectory. | |
int | skip (int number) |
Skips over and discards n bytes of data from this input stream. | |
long long | available () const |
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. | |
bool | markSupported () const |
Tests if this input stream supports the mark and reset methods. | |
void | mark (int readlimit) |
Marks the current position in this input stream. | |
void | reset () |
Repositions this stream to the position at the time the mark method was last called on this input stream. | |
virtual void | close ()=0 |
Closes this input stream and releases any system resources associated with the stream. | |
virtual Object & | self () |
Returns a reference to itself. | |
virtual const Object & | self () const |
Object * | clone () const |
Instantiates another object of the same class as a copy of itself. | |
virtual uint64_t | getId () const |
Returns a unique object id. | |
virtual const String | toString () const |
Returns a string representation of the object. By default, it returns the object's class and the objects's id. | |
virtual const String | inspect () const |
Returns a string containing human-readable representation of the object. | |
Protected Member Functions | |
int | filterReadEvents (int n) |
long long sk::io::AbstractInputStream::available | ( | ) | const [virtual] |
Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream.
Implements sk::io::InputStream.
Reimplemented in sk::io::ByteArrayInputStream, sk::io::DelegatingInputStream, and sk::io::FileInputStream.
Object* sk::util::Object::clone | ( | ) | const [inherited] |
Instantiates another object of the same class as a copy of itself.
Reimplemented in sk::rt::logger::Destination, and sk::util::String.
virtual void sk::io::InputStream::close | ( | ) | [pure virtual, inherited] |
Closes this input stream and releases any system resources associated with the stream.
Implemented in sk::io::ByteArrayInputStream, sk::io::DelegatingInputStream, and sk::io::FileDescriptorInputStream.
int sk::io::AbstractInputStream::filterReadEvents | ( | int | n | ) | [protected] |
const sk::util::Class sk::io::AbstractInputStream::getClass | ( | ) | const [virtual] |
Returns the object's class.
Reimplemented from sk::util::Object.
Reimplemented in sk::io::BufferedInputStream, sk::io::ByteArrayInputStream, sk::io::DataInputStream, sk::io::DelegatingInputStream, sk::io::FileDescriptorInputStream, and sk::io::FileInputStream.
virtual uint64_t sk::util::Object::getId | ( | ) | const [virtual, inherited] |
virtual const String sk::util::Object::inspect | ( | ) | const [virtual, inherited] |
Returns a string containing human-readable representation of the object.
Reimplemented in sk::rt::thread::AbstractLock, sk::rt::Thread, sk::util::Class, sk::util::Container, sk::util::slot::Pointer< T, Mixin >, sk::util::slot::Reference< T, Mixin >, sk::util::String, and sk::util::StringArray.
void sk::io::AbstractInputStream::mark | ( | int | readlimit | ) | [virtual] |
Marks the current position in this input stream.
Implements sk::io::InputStream.
Reimplemented in sk::io::ByteArrayInputStream, and sk::io::DelegatingInputStream.
bool sk::io::AbstractInputStream::markSupported | ( | ) | const [virtual] |
Tests if this input stream supports the mark and reset methods.
Implements sk::io::InputStream.
Reimplemented in sk::io::ByteArrayInputStream, and sk::io::DelegatingInputStream.
std::vector<char>& sk::io::AbstractInputStream::read | ( | std::vector< char > & | buffer, | |
int | number | |||
) | [virtual] |
Reads up to number bytes of data from the input stream into the specified vector of chars. The vector size will be adjusted depending on the actual amount of date read. Returns a reference to the same vectory.
Implements sk::io::InputStream.
std::vector<char> sk::io::AbstractInputStream::read | ( | int | number | ) | [virtual] |
Reads up to number bytes of data from the input stream and returns them as a vector of chars.
Implements sk::io::InputStream.
char sk::io::AbstractInputStream::read | ( | ) | [virtual] |
virtual int sk::io::AbstractInputStream::read | ( | char * | buffer, | |
int | offset, | |||
int | length | |||
) | [pure virtual] |
Reads up to lenght bytes of data from the input stream into an array of bytes starting from offset.
Implements sk::io::InputStream.
Implemented in sk::io::BufferedInputStream, sk::io::ByteArrayInputStream, sk::io::DelegatingInputStream, and sk::io::FileDescriptorInputStream.
void sk::io::AbstractInputStream::reset | ( | ) | [virtual] |
Repositions this stream to the position at the time the mark method was last called on this input stream.
Implements sk::io::InputStream.
Reimplemented in sk::io::ByteArrayInputStream, and sk::io::DelegatingInputStream.
virtual const Object& sk::util::Object::self | ( | ) | const [virtual, inherited] |
Reimplemented in sk::util::String.
virtual Object& sk::util::Object::self | ( | ) | [virtual, inherited] |
int sk::io::AbstractInputStream::skip | ( | int | number | ) | [virtual] |
Skips over and discards n bytes of data from this input stream.
Implements sk::io::InputStream.
Reimplemented in sk::io::ByteArrayInputStream, and sk::io::DelegatingInputStream.
virtual const String sk::util::Object::toString | ( | ) | const [virtual, inherited] |
Returns a string representation of the object. By default, it returns the object's class and the objects's id.
Reimplemented in sk::rt::logger::Level, sk::rt::thread::State, sk::util::Boolean, sk::util::Class, sk::util::Container, sk::util::Pathname, and sk::util::String.