#include <src/main/decaf/io/Writer.h>
Protected Member Functions |
virtual void | doWriteArrayBounded (const char *buffer, int size, int offset, int length)=0 |
| Override this method to customize the functionality of the method write( char* buffer, int size, int offset, int length ).
|
virtual void | doWriteChar (char v) |
virtual void | doWriteVector (const std::vector< char > &buffer) |
virtual void | doWriteArray (const char *buffer, int size) |
virtual void | doWriteString (const std::string &str) |
virtual void | doWriteStringBounded (const std::string &str, int offset, int length) |
virtual decaf::lang::Appendable & | doAppendChar (char value) |
virtual decaf::lang::Appendable & | doAppendCharSequence (const decaf::lang::CharSequence *csq) |
virtual decaf::lang::Appendable & | doAppendCharSequenceStartEnd (const decaf::lang::CharSequence *csq, int start, int end) |
Constructor & Destructor Documentation
decaf::io::Writer::Writer |
( |
| ) |
|
virtual decaf::io::Writer::~Writer |
( |
| ) |
|
|
virtual |
Member Function Documentation
Appends the specified character to this Appendable.
- Parameters
-
value | The character to append. |
- Returns
- a Reference to this Appendable
- Exceptions
-
Exception | if an error occurs. |
Implements decaf::lang::Appendable.
Appends the specified character sequence to this Appendable.
- Parameters
-
csq | The character sequence from which a subsequence will be appended. If csq is NULL, then characters will be appended as if csq contained the string "null". |
- Returns
- a Reference to this Appendable.
- Exceptions
-
Exception | if an error occurs. |
Implements decaf::lang::Appendable.
Appends a subsequence of the specified character sequence to this Appendable.
- Parameters
-
csq | - The character sequence from which a subsequence will be appended. If csq is NULL, then characters will be appended as if csq contained the string "null". |
start | The index of the first character in the subsequence. |
end | The index of the character following the last character in the subsequence. |
- Returns
- a Reference to this Appendable
- Exceptions
-
Exception | if an error occurs. |
IndexOutOfBoundsException | start is greater than end, or end is greater than csq.length() |
Implements decaf::lang::Appendable.
virtual void decaf::io::Writer::doWriteArray |
( |
const char * |
buffer, |
|
|
int |
size |
|
) |
| |
|
protectedvirtual |
virtual void decaf::io::Writer::doWriteArrayBounded |
( |
const char * |
buffer, |
|
|
int |
size, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
protectedpure virtual |
Override this method to customize the functionality of the method write( char* buffer, int size, int offset, int length ).
All subclasses must override this method to provide the basic Writer functionality.
Implemented in decaf::io::OutputStreamWriter.
virtual void decaf::io::Writer::doWriteChar |
( |
char |
v | ) |
|
|
protectedvirtual |
virtual void decaf::io::Writer::doWriteString |
( |
const std::string & |
str | ) |
|
|
protectedvirtual |
virtual void decaf::io::Writer::doWriteStringBounded |
( |
const std::string & |
str, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
protectedvirtual |
virtual void decaf::io::Writer::doWriteVector |
( |
const std::vector< char > & |
buffer | ) |
|
|
protectedvirtual |
virtual void decaf::io::Writer::write |
( |
char |
v | ) |
|
|
virtual |
Writes an single byte char value.
- Parameters
-
v | The value to be written. |
- Exceptions
-
virtual void decaf::io::Writer::write |
( |
const std::vector< char > & |
buffer | ) |
|
|
virtual |
Writes an array of Chars.
- Parameters
-
buffer | The array to be written. |
- Exceptions
-
virtual void decaf::io::Writer::write |
( |
const char * |
buffer, |
|
|
int |
size |
|
) |
| |
|
virtual |
Writes a byte array to the output stream.
- Parameters
-
buffer | The byte array to write (cannot be NULL). |
size | The size in bytes of the buffer passed. |
- Exceptions
-
IOException | if an I/O error occurs. |
NullPointerException | if buffer is NULL. |
virtual void decaf::io::Writer::write |
( |
const char * |
buffer, |
|
|
int |
size, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
virtual |
Writes a byte array to the output stream.
- Parameters
-
buffer | The byte array to write (cannot be NULL). |
size | The size in bytes of the buffer passed. |
offset | The position in the array to start writing from. |
length | The number of bytes in the array to write. |
- Exceptions
-
IOException | if an I/O error occurs. |
NullPointerException | if buffer is NULL. |
IndexOutOfBoundsException | if offset + length > size of the buffer. |
virtual void decaf::io::Writer::write |
( |
const std::string & |
str | ) |
|
|
virtual |
Writes a string.
- Parameters
-
str | The string to be written. |
- Exceptions
-
virtual void decaf::io::Writer::write |
( |
const std::string & |
str, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
virtual |
Writes a string.
- Parameters
-
str | The string to be written. |
offset | The position in the array to start writing from. |
length | The number of bytes in the array to write. |
- Exceptions
-
IOException | thrown if an error occurs. |
IndexOutOfBoundsException | if offset+length is greater than the string length. |
The documentation for this class was generated from the following file: