Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.io.PrintStream;
- import java.net.Socket;
- public class ReadIn
- extends Thread
- {
- public String last = "";
- public String part1 = "";
- public String part3 = "";
- private BufferedReader in;
- public ReadIn(Socket socket)
- {
- try
- {
- this.in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
- public void run()
- {
- try
- {
- for (;;)
- {
- this.last = this.in.readLine();
- if ((this.last != null) &&
- (this.last.contains("miner-notify")))
- {
- System.out.println(this.last);
- this.part1 = this.last.substring(this.last.indexOf("part1\":") + 8, this.last.indexOf("payload_start") - 3);
- this.part3 = this.last.substring(this.last.indexOf("part3\":") + 8, this.last.indexOf("target") - 3);
- System.out.println("Part1: " + this.part1);
- System.out.println("Part3: " + this.part3);
- }
- }
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment