/** Write an array. * @param outputStream is the output stream,. * @param values is the array. */ static void writeHomogeneousArray(final OutputStream outputStream, final SerializableObject[] values) throws IOException { if (values == null) { writeInt(outputStream, 0); } else { writeInt(outputStream, values.length); for (final SerializableObject value : values) { value.write(outputStream); } } }
/** Write an object to a stream. * @param outputStream is the output stream. * @param object is the object to write. */ public static void writeObject(final OutputStream outputStream, final SerializableObject object) throws IOException { writeClass(outputStream, object.getClass()); object.write(outputStream); }
/** Write an array. * @param outputStream is the output stream,. * @param values is the array. */ static void writeHomogeneousArray(final OutputStream outputStream, final List<? extends SerializableObject> values) throws IOException { if (values == null) { writeInt(outputStream, 0); } else { writeInt(outputStream, values.size()); for (final SerializableObject value : values) { value.write(outputStream); } } }