Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 7f00000000000000000000000000000000000000000000000000000000000000027f00000000000000000000000000000000000000000000000000000000000000027f00000000000000000000000000000000000000000000000000000000000000020101
- 7f00000000000000000000000000000000000000000000000000000000000000037f00000000000000000000000000000000000000000000000000000000000000037f00000000000000000000000000000000000000000000000000000000000000030101
- 7f00000000000000000000000000000000000000000000000000000000000000047f00000000000000000000000000000000000000000000000000000000000000047f00000000000000000000000000000000000000000000000000000000000000040101
- 7f00000000000000000000000000000000000000000000000000000000000000057f00000000000000000000000000000000000000000000000000000000000000057f00000000000000000000000000000000000000000000000000000000000000050101
- 7f00000000000000000000000000000000000000000000000000000000000000067f00000000000000000000000000000000000000000000000000000000000000067f00000000000000000000000000000000000000000000000000000000000000060101
- import java.io.*;
- import java.util.Scanner;
- import java.util.List;
- import java.util.ArrayList;
- class showMe {
- public static void main(String[] args) {
- // populate from file
- List<String> inputLinesObject = new ArrayList<String>();
- inputLinesObject = readFile("/Users/s.matthew.english/ConsenSys/PegaSys/sprint/txs/codes.txt", inputLinesObject);
- // print output
- for(String str : inputLinesObject){
- //System.out.println(str);
- // now run the command on the terminal and get the result
- try {
- Runtime rt = Runtime.getRuntime();
- String command = "evm --debug --code " + str + " run";
- Process proc = rt.exec(command);
- BufferedReader stdInput = new BufferedReader(new
- InputStreamReader(proc.getInputStream()));
- BufferedReader stdError = new BufferedReader(new
- InputStreamReader(proc.getErrorStream()));
- // read the output from the command
- System.out.println("Here is the standard output of the command:n");
- String s = null;
- while ((s = stdInput.readLine()) != null) {
- System.out.println(s);
- }
- // read any errors from the attempted command
- System.out.println("Here is the standard error of the command (if any):n");
- while ((s = stdError.readLine()) != null) {
- System.out.println(s);
- }
- } catch (IOException e) {
- System.out.println(e);
- }
- }
- }
- private static List<String> readFile(String fileName, List<String> inputLines) {
- try {
- File file = new File(fileName);
- Scanner scanner = new Scanner(file);
- while (scanner.hasNextLine()) {
- inputLines.add(scanner.nextLine());
- }
- scanner.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- return inputLines;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement