/** * Write a char into the byte stream, and ensure it is 4 byte aligned again. * @param aChar the character to be written */ public void write(Character aChar) { stream.write((char) aChar); alignStream(); }
/** * Write types for the arguments. * @param arguments the arguments to an OSCMessage */ public void writeTypes(Collection<Object> arguments) { writeTypesArray(arguments); // we always need to terminate with a zero, // even if (especially when) the stream is already aligned. stream.write(0); // align the stream with padded bytes alignStream(); }
/** * Write a string into the byte stream. * @param aString the string to be written */ public void write(String aString) { final byte[] stringBytes = aString.getBytes(charset); writeUnderHandler(stringBytes); stream.write(0); alignStream(); }
/** * Write bytes into the byte stream. * @param bytes bytes to be written */ public void write(byte[] bytes) { writeInteger32ToByteArray(bytes.length); writeUnderHandler(bytes); alignStream(); }