private byte[] msg2bytes( Message msg, Boolean stringTypeAndField ) throws IOException
{
FlexBuffer buf = new FlexBuffer();
URL u = new URL( "none:" );
if (stringTypeAndField != null)
u.addTerm( BinaryTaggedDataOutput.STRING_TYPE_AND_FIELD, stringTypeAndField );
BinaryTaggedDataOutput btdo = new BinaryTaggedDataOutput( vf, u.toString() );
btdo.writeMessage( msg, buf );
buf.setIndex( 0 );
return buf.getAvailBytes();
}