compiler, lib: java: split Input and OutputProtocol