/** * Starts a new CZML packet on the given stream. * @param output The stream to which to write the packet. * @return The packet writer. */ @Nonnull public final PacketCesiumWriter openPacket(@Nonnull CesiumOutputStream output) { PacketCesiumWriter packetWriter = m_packetWriter.getValue(); packetWriter.open(output); return packetWriter; }
@Test public final void opensObjectLiteralOnOpenAndClosesItOnClose() { PacketCesiumWriter packet = new PacketCesiumWriter(); packet.open(m_outputStream); Assert.assertEquals("{", m_stringWriter.toString()); packet.close(); Assert.assertEquals("{}", m_stringWriter.toString()); }