title: check spaces using ascii code
body: <p>I'm trying to remove spaces from a file while reading it. I do this by checking the ascii code of the char .. if it is not 127 (space) then print it out. </p>
  
  <p>What is a better way to think of it?
  or how to fix it this way?</p>
  
  <pre><code>private FileInputStream sc;
  private static char input;
  
  public void openFile(){
  try{
      sc = new FileInputStream(new File ("D:\\Empty.txt"));
      input = (char) sc.read();
      if(input != 127){
          System.out.println(input);
      }
  }catch(FileNotFoundException e){
      e.printStackTrace();
      } catch (IOException e) {
      e.printStackTrace();
      }
  }
  
  public static void main(String[] args) {
  
      ParsingStrings ps = new ParsingStrings();
      ps.openFile();
  
  }
  </code></pre>