org.joda.beans.ser.bin
Class MsgPackOutput

java.lang.Object
  extended by org.joda.beans.ser.bin.MsgPack
      extended by org.joda.beans.ser.bin.MsgPackOutput

public final class MsgPackOutput
extends MsgPack

Outputter for MsgPack data.


Constructor Summary
MsgPackOutput(DataOutputStream stream)
          Creates an instance.
MsgPackOutput(OutputStream stream)
          Creates an instance.
 
Method Summary
 void close()
          Closes the underlying stream.
 void writeArrayHeader(int size)
          Writes a MessagePack array header.
 void writeBoolean(boolean value)
          Writes a MessagePack boolean.
 void writeBytes(byte[] bytes)
          Writes a MessagePack byte block.
 void writeDouble(double value)
          Writes a MessagePack double.
 void writeExtensionByte(int extensionType, int value)
          Writes an extension string using FIX_EXT_1.
 void writeExtensionString(int extensionType, String str)
          Writes an extension string using EXT_8.
 void writeFloat(float value)
          Writes a MessagePack float.
 void writeInt(int value)
          Writes a MessagePack int.
 void writeLong(long value)
          Writes a MessagePack long.
 void writeMapHeader(int size)
          Writes a MessagePack map header.
 void writeNil()
          Writes a MessagePack nil.
 void writeString(String value)
          Writes a MessagePack string.
 
Methods inherited from class org.joda.beans.ser.bin.MsgPack
isArray, isIntegral, isMap, isString, toHex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MsgPackOutput

public MsgPackOutput(OutputStream stream)
Creates an instance.

Parameters:
stream - the stream to write to, not null

MsgPackOutput

public MsgPackOutput(DataOutputStream stream)
Creates an instance.

Parameters:
stream - the stream to write to, not null
Method Detail

writeNil

public void writeNil()
              throws IOException
Writes a MessagePack nil.

Throws:
IOException - if an error occurs

writeBoolean

public void writeBoolean(boolean value)
                  throws IOException
Writes a MessagePack boolean.

Parameters:
value - the value
Throws:
IOException - if an error occurs

writeInt

public void writeInt(int value)
              throws IOException
Writes a MessagePack int.

Parameters:
value - the value
Throws:
IOException - if an error occurs

writeLong

public void writeLong(long value)
               throws IOException
Writes a MessagePack long.

Parameters:
value - the value
Throws:
IOException - if an error occurs

writeFloat

public void writeFloat(float value)
                throws IOException
Writes a MessagePack float.

Parameters:
value - the value
Throws:
IOException - if an error occurs

writeDouble

public void writeDouble(double value)
                 throws IOException
Writes a MessagePack double.

Parameters:
value - the value
Throws:
IOException - if an error occurs

writeBytes

public void writeBytes(byte[] bytes)
                throws IOException
Writes a MessagePack byte block.

Parameters:
bytes - the bytes, not null
Throws:
IOException - if an error occurs

writeString

public void writeString(String value)
                 throws IOException
Writes a MessagePack string.

Parameters:
value - the value
Throws:
IOException - if an error occurs

writeArrayHeader

public void writeArrayHeader(int size)
                      throws IOException
Writes a MessagePack array header.

Parameters:
size - the size
Throws:
IOException - if an error occurs

writeMapHeader

public void writeMapHeader(int size)
                    throws IOException
Writes a MessagePack map header.

Parameters:
size - the size
Throws:
IOException - if an error occurs

writeExtensionByte

public void writeExtensionByte(int extensionType,
                               int value)
                        throws IOException
Writes an extension string using FIX_EXT_1.

Parameters:
extensionType - the type
value - the value to write as the data
Throws:
IOException - if an error occurs

writeExtensionString

public void writeExtensionString(int extensionType,
                                 String str)
                          throws IOException
Writes an extension string using EXT_8.

Parameters:
extensionType - the type
str - the string to write as the data
Throws:
IOException - if an error occurs

close

public void close()
           throws IOException
Closes the underlying stream.

Throws:
IOException - if an error occurs


Copyright © 2007–2014 Joda.org. All rights reserved.