Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class ASCII extends FilterInputStream{
- public ASCII(InputStream in){
- super(in);
- }
- public int read()
- {
- int c;
- try {
- c = this.in.read();
- boolean exit=false;
- // <(60),>(62),!(33),-(45)
- while(c==60){ // <
- c=this.in.read();
- if(c==33){ //!
- c=this.in.read();
- if(c==45){ //-
- c=this.in.read();
- if(c==45){ //-
- do{
- c=this.in.read(); //text inside
- if(c==45){ //-
- c=this.in.read();
- if(c==45){ //-
- c=this.in.read();
- if(c==62){ // >
- exit=true;
- }
- }
- }
- }while(exit==false)
- c=this.in.read();
- }
- }
- }else{
- while(c!=62){ // >
- c=this.in.read();
- }
- c=this.in.read();
- }
- }
- return c;
- }catch(IOException e) {
- System.out.println("error en HTMLtoASCII");
- }
- return -1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement