List of usage examples for io.netty.handler.codec.serialization ObjectEncoderOutputStream ObjectEncoderOutputStream
public ObjectEncoderOutputStream(OutputStream out)
From source file:de.sanandrew.core.manpack.util.javatuples.Tuple.java
License:Apache License
public static void writeToByteBufStream(Tuple tuple, ByteBufOutputStream stream) { try (ObjectEncoderOutputStream oeos = new ObjectEncoderOutputStream(stream)) { oeos.writeObject(tuple);/*w w w . java2 s.co m*/ } catch (IOException ex) { ManPackLoadingPlugin.MOD_LOG.log(Level.ERROR, "Cannot serialize Tuple!", ex); } }
From source file:de.sanandrew.mods.sanlib.lib.Tuple.java
License:Creative Commons License
/** * Serializes this Tuple and writes it into an OutputStream via an {@link ObjectEncoderOutputStream}. * @param stream The OutputStream this Tuple should be written in. *//*from ww w . j a v a 2 s . c o m*/ public void writeToStream(OutputStream stream) { try (ObjectEncoderOutputStream oeos = new ObjectEncoderOutputStream(stream)) { oeos.writeObject(this); } catch (IOException ex) { SanLib.LOG.log(Level.ERROR, "Cannot serialize Tuple!", ex); } }