Om
1.0.0
A universal framework for multimedia simulation
|
A class/interface which represents an abstract write-only stream of data. More...
#include <omDataOutputStream.h>
Public Member Functions | |
virtual | ~DataOutputStream () |
Destroy an output stream and free all of its resources (close it). More... | |
Size | writeData (const data::Data &data) |
Write as much of the specified data array to the stream and return the number of bytes written. More... | |
Size | writeData (const data::DataBuffer &dataBuffer) |
Write as much of the specified data array to the stream and return the number of bytes written. More... | |
virtual Size | writeData (const UByte *data, Size number)=0 |
Write the specified number of bytes of data from the buffer to the stream. More... | |
virtual void | flush ()=0 |
Flush the output stream, sending all internally buffered output to it's destination. More... | |
virtual Bool | canSeek () const =0 |
Return whether or not this type of stream allows seeking. More... | |
virtual Bool | canSeek (Int64 relativeOffset) const =0 |
Return whether or not this stream can seek by the specified amount in bytes. More... | |
virtual Int64 | seek (Int64 relativeOffset)=0 |
Move the current position in the stream by the specified relative signed offset in bytes. More... | |
virtual LargeIndex | getPosition () const =0 |
Return the absolute position in the stream in bytes. More... | |
A class/interface which represents an abstract write-only stream of data.
|
inlinevirtual |
Destroy an output stream and free all of its resources (close it).
|
inline |
Write as much of the specified data array to the stream and return the number of bytes written.
|
inline |
Write as much of the specified data array to the stream and return the number of bytes written.
Write the specified number of bytes of data from the buffer to the stream.
The method returns the number of bytes that were actually written.
Implemented in om::io::BinaryEncoder, om::resources::ResourceEncoder, om::io::FileWriter, and om::compression::CompressedOutputStream.
|
pure virtual |
Flush the output stream, sending all internally buffered output to it's destination.
This method causes all currently pending output data to be sent to it's final destination. This method ensures that this is done and that all internal data buffers are emptied if they have any contents.
Implemented in om::io::BinaryEncoder, om::resources::ResourceEncoder, om::io::FileWriter, and om::compression::CompressedOutputStream.
|
pure virtual |
Return whether or not this type of stream allows seeking.
Some types of IO (like files) allow seeking, but others, especially those over networks don't allow streaming. This method allows the user to detect that situation.
Implemented in om::io::BinaryEncoder, om::resources::ResourceEncoder, om::io::FileWriter, and om::compression::CompressedOutputStream.
Return whether or not this stream can seek by the specified amount in bytes.
Since some streams may not support rewinding, this method can be used to determine if a given seek operation can succeed. The method can also be used to determine if the end of a stream has been reached, a seek past the end of a file will fail.
Implemented in om::io::BinaryEncoder, om::resources::ResourceEncoder, om::io::FileWriter, and om::compression::CompressedOutputStream.
Move the current position in the stream by the specified relative signed offset in bytes.
The method attempts to seek in the stream by the specified amount and returns the signed amount that the position in the stream was changed by in bytes. A negative offset indicates that the position should be moved in reverse and a positive offset indicates that the position should be moved forwards.
Implemented in om::io::BinaryEncoder, om::resources::ResourceEncoder, om::io::FileWriter, and om::compression::CompressedOutputStream.
|
pure virtual |
Return the absolute position in the stream in bytes.
Implemented in om::io::BinaryEncoder, om::resources::ResourceEncoder, om::io::FileWriter, and om::compression::CompressedOutputStream.