Java ProcessBuilder how to get binary output from command
问题 I am trying to use execute a command using ProcessBuilder. The command is supposed to write binary data on stdout. How can I get this data in my byte[] ? 回答1: This is a working example that returns true for output 1 and false for output 0 , (throws Exception in all other cases). I also added setting a working path and an environment variable, which is not required for your particular example so you can delete it. You can copy paste this code as a class, compile it to jar and run it. It is