Writer base-class. Writers provide the means to append formatted
data to an IBuffer, and expose a convenient method of handling a
variety of data types. In addition to writing native types such
as integer and char[], writers also process any class which has
implemented the IWritable interface (one method).
All writers support the full set of native data types, plus their
fundamental array variants. Operations may be chained back-to-back.
- this(IProtocol protocol) ¶#
-
Construct a Writer on the provided Protocol
- this(OutputStream stream) ¶#
-
Construct a Writer on the given OutputStream. We do our own
protocol handling, equivalent to the NativeProtocol.
- IBuffer buffer() [final] ¶#
-
Return the associated buffer
- IWriter newline() ¶#
-
Emit a newline
- IWriter newline(char[] eol) ¶#
-
set the newline sequence
- IWriter flush() [final] ¶#
-
Flush the output of this writer and return a chaining ref
- IWriter put() [final] ¶#
-
Flush this writer. This is a convenience method used by
the "whisper" syntax.
- IWriter put(IWriter.Closure dg) [final] ¶#
-
Write via a delegate to the current buffer-position
- IWriter put(IWritable x) [final] ¶#
-
Write a class to the current buffer-position
- IWriter put(bool x) [final] ¶#
-
Write a boolean value to the current buffer-position
- IWriter put(ubyte x) [final] ¶#
-
Write an unsigned byte value to the current buffer-position
- IWriter put(byte x) [final] ¶#
-
Write a byte value to the current buffer-position
- IWriter put(ushort x) [final] ¶#
-
Write an unsigned short value to the current buffer-position
- IWriter put(short x) [final] ¶#
-
Write a short value to the current buffer-position
- IWriter put(uint x) [final] ¶#
-
Write a unsigned int value to the current buffer-position
- IWriter put(int x) [final] ¶#
-
Write an int value to the current buffer-position
- IWriter put(ulong x) [final] ¶#
-
Write an unsigned long value to the current buffer-position
- IWriter put(long x) [final] ¶#
-
Write a long value to the current buffer-position
- IWriter put(float x) [final] ¶#
-
Write a float value to the current buffer-position
- IWriter put(double x) [final] ¶#
-
Write a double value to the current buffer-position
- IWriter put(real x) [final] ¶#
-
Write a real value to the current buffer-position
- IWriter put(char x) [final] ¶#
-
Write a char value to the current buffer-position
- IWriter put(wchar x) [final] ¶#
-
Write a wchar value to the current buffer-position
- IWriter put(dchar x) [final] ¶#
-
Write a dchar value to the current buffer-position
- IWriter put(bool[] x) [final] ¶#
-
Write a boolean array to the current buffer-position
- IWriter put(byte[] x) [final] ¶#
-
Write a byte array to the current buffer-position
- IWriter put(ubyte[] x) [final] ¶#
-
Write an unsigned byte array to the current buffer-position
- IWriter put(short[] x) [final] ¶#
-
Write a short array to the current buffer-position
- IWriter put(ushort[] x) [final] ¶#
-
Write an unsigned short array to the current buffer-position
- IWriter put(int[] x) [final] ¶#
-
Write an int array to the current buffer-position
- IWriter put(uint[] x) [final] ¶#
-
Write an unsigned int array to the current buffer-position
- IWriter put(long[] x) [final] ¶#
-
Write a long array to the current buffer-position
- IWriter put(ulong[] x) [final] ¶#
-
Write an unsigned long array to the current buffer-position
- IWriter put(float[] x) [final] ¶#
-
Write a float array to the current buffer-position
- IWriter put(double[] x) [final] ¶#
-
Write a double array to the current buffer-position
- IWriter put(real[] x) [final] ¶#
-
Write a real array to the current buffer-position
- IWriter put(char[] x) [final] ¶#
-
Write a char array to the current buffer-position
- IWriter put(wchar[] x) [final] ¶#
-
Write a wchar array to the current buffer-position
- IWriter put(dchar[] x) [final] ¶#
-
Write a dchar array to the current buffer-position
- void writeArray(void* src, uint bytes, IProtocol.Type type) [private] ¶#
-
Dump array content into the buffer. Note that the default
behaviour is to prefix with the array byte count
- void writeElement(void* src, uint bytes, IProtocol.Type type) [private] ¶#
-
Dump content into the buffer