Code example for ObjectOutputStream

Methods: flushresetwriteObject

0
	protected void processMessage() throws InterruptedException, IOException { 
		ClientChannel channel = ensureAttached();
		Message message = channel.takeOutput();
		if (message != null) {
			try { 
				os.writeObject(message);
				os.reset();
				os.flush();
				System.out.println(getName() + " SENT: " + message);
			} catch (IOException e) {
				channel.send(message, null);
				throw e;
			} 
		} 
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java