@Override public void write(final OutputStream outputStream) throws IOException { SerializableObject.writeObject(outputStream, point1); SerializableObject.writeObject(outputStream, point2); SerializableObject.writeObject(outputStream, point3); SerializableObject.writeObject(outputStream, point4); }
@Override public void writeShape(DataOutput dataOutput, Shape s) throws IOException { if (s instanceof Geo3dShape) { Geo3dShape geoAreaShape = (Geo3dShape) s; SerializableObject.writeObject((OutputStream) dataOutput, geoAreaShape.shape); } else { throw new IllegalArgumentException("trying to write a not supported shape: " + s.getClass().getName()); } }
/** Write an array. * @param outputStream is the output stream,. * @param values is the array. */ static void writeHeterogeneousArray(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) { writeObject(outputStream, value); } } }
/** Write a PlanetObject to a stream. * @param outputStream is the output stream. * @param object is the object to write. */ public static void writePlanetObject(final OutputStream outputStream, final PlanetObject object) throws IOException { object.getPlanetModel().write(outputStream); writeObject(outputStream, object); }
/** Write an array. * @param outputStream is the output stream,. * @param values is the array. */ static void writeHeterogeneousArray(final OutputStream outputStream, final SerializableObject[] values) throws IOException { if (values == null) { writeInt(outputStream, 0); } else { writeInt(outputStream, values.length); for (final SerializableObject value : values) { writeObject(outputStream, value); } } }