Results 1 to 2 of 2

Thread: Data input stream has been deprecated

  1. #1

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Data input stream has been deprecated

    Code:
         // String for line input
            String iLine="";
                
    
                   
    
              // Begin While loop, loop it up
              while (in.available() !=0) { 
           
                    // grab line from file and place into temp storage 
                    iLine = in.readLine();
                                               
                    model.addElement(iLine);
                    
                    
      
               
              } // end while
    iLine = in.readLine(); is giving a data input deprecated warning, how do I fix it? Im not getting any blank lines, I want those blank lines.

    Thanks

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Data input stream has been deprecated

    This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method.

    But if you want to use the deprecated method anyway you can just note your method with @Deprecated so the compiler allows it
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width