Advertisement
Guest User

TorReader

a guest
Jan 3rd, 2017
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. package tor;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.io.InputStreamReader;
  6.  
  7. public class TorReader {
  8.  
  9. private InputStreamReader in;
  10.  
  11. public TorReader(InputStream in){
  12. this.in = new InputStreamReader(in);
  13. }
  14.  
  15. public String read() throws IOException{
  16. int[] buf = new int[100];
  17. int counter=0;
  18. int c;
  19. while((c = in.read())!='\r'){
  20. buf[counter++]=c;
  21. //System.out.print(Character.toChars(c));
  22. }
  23. while((c = in.read()) != '\n');
  24. return new String(buf, 0, counter);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement