Advertisement
Guest User

Untitled

a guest
Mar 20th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import java.io.*;
  2. public class ASCII extends FilterInputStream{
  3.  
  4.  
  5. public ASCII(InputStream in){
  6. super(in);
  7. }
  8.  
  9. public int read()
  10. {
  11. int c;
  12. try {
  13. c = this.in.read();
  14. boolean exit=false;
  15. // <(60),>(62),!(33),-(45)
  16. while(c==60){ // <
  17.  
  18. c=this.in.read();
  19. if(c==33){ //!
  20. c=this.in.read();
  21. if(c==45){ //-
  22. c=this.in.read();
  23. if(c==45){ //-
  24. do{
  25. c=this.in.read(); //text inside
  26. if(c==45){ //-
  27. c=this.in.read();
  28. if(c==45){ //-
  29. c=this.in.read();
  30. if(c==62){ // >
  31. exit=true;
  32. }
  33. }
  34. }
  35. }while(exit==false)
  36. c=this.in.read();
  37. }
  38. }
  39. }else{
  40. while(c!=62){ // >
  41. c=this.in.read();
  42. }
  43. c=this.in.read();
  44. }
  45.  
  46.  
  47.  
  48.  
  49. }
  50. return c;
  51.  
  52. }catch(IOException e) {
  53. System.out.println("error en HTMLtoASCII");
  54. }
  55. return -1;
  56. }
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement