public static Message parseMessage ( Method parseMethod , InputStream in ) { try { return ( Message ) parseMethod . invoke ( null , in ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e ) ; } }
Parse the message in a given InputStream using scpecified Method