public static byte [ ] serializeServiceInstance ( ServiceInstance serviceInstance , Codec < ServiceInstance > codec ) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; codec . serialize ( serviceInstance , output ) ; return output . toByteArray ( ) ; }
Returns a serialized Thrift service instance object with given endpoints and codec .