Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /* ************************************************************************
 #
 #  DivConq
 #
 #  http://divconq.com/
 #
 #  Copyright:
 #    Copyright 2014 eTimeline, LLC. All rights reserved.
 #
#  License:
#    See the license.txt file in the project's top-level directory for details.
#  Authors:
#    * Andy White
************************************************************************ */
package divconq.bus.net;
	protected void encode(ChannelHandlerContext ctxStreamMessage msgByteBuf outthrows Exception {
		msg.toSerial(out);
		if (msg.hasData()) {
			ByteBuf bb = msg.getData();
			try {
				out.writeBytes(bb);
			}
			finally {
				bb.release();		// buffer no longer needed
			}
		}
		else
			out.writeInt(0);
	}
New to GrepCode? Check out our FAQ X