|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.illposed.osc.utility.OSCJavaToByteArrayConverter
OSCJavaToByteArrayConverter is a helper class that translates from Java types to their byte stream representations according to the OSC spec.
The implementation is based on Markus Gaelli and Iannis Zannos' OSC implementation in Squeak.
This version includes bug fixes and improvements from Martin Kaltenbrunner and Alex Potsides.
Copyright (C) 2003-2006, C. Ramakrishnan / Illposed Software. All rights reserved.
See license.txt (or license.rtf) for license information.
| Field Summary | |
protected java.io.ByteArrayOutputStream |
stream
|
| Constructor Summary | |
OSCJavaToByteArrayConverter()
|
|
| Method Summary | |
void |
appendNullCharToAlignStream()
Pad the stream to have a size divisible by 4. |
byte[] |
toByteArray()
Convert the contents of the output stream to a byte array. |
void |
write(java.math.BigInteger i)
|
void |
write(byte[] bytes)
Write bytes into the byte stream. |
void |
write(char c)
Write a char into the byte stream. |
void |
write(java.lang.Float f)
Write a float into the byte stream. |
void |
write(int i)
Write an int into the byte stream. |
void |
write(java.lang.Integer i)
|
void |
write(java.lang.Object anObject)
Write an object into the byte stream. |
void |
write(java.lang.String aString)
Write a string into the byte stream. |
void |
writeType(java.lang.Class c)
Write the type tag for the type represented by the class |
void |
writeTypes(java.util.Vector vector)
Write types for the arguments (use a vector for jdk1.1 compatibility, rather than an ArrayList). |
void |
writeTypesArray(java.lang.Object[] array)
Write the types for an array element in the arguments. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.io.ByteArrayOutputStream stream
| Constructor Detail |
public OSCJavaToByteArrayConverter()
| Method Detail |
public void appendNullCharToAlignStream()
public byte[] toByteArray()
public void write(byte[] bytes)
bytes - byte[]public void write(int i)
i - intpublic void write(java.lang.Float f)
f - java.lang.Floatpublic void write(java.lang.Integer i)
i - java.lang.Integerpublic void write(java.math.BigInteger i)
i - java.lang.Integerpublic void write(java.lang.String aString)
aString - java.lang.Stringpublic void write(char c)
c - charpublic void write(java.lang.Object anObject)
anObject - one of Float, String, Integer, BigInteger, or array of these.public void writeType(java.lang.Class c)
c - Class of a Java object in the argumentspublic void writeTypesArray(java.lang.Object[] array)
array - java.lang.Object[]public void writeTypes(java.util.Vector vector)
vector - the arguments to an OSCMessage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||