Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

casting to char + end of file

Wed May 20, 2009 10:54 am

Hello

I create a file (display.txt) with content:

Code:
identity:identity number:endidentityname:Enter Your
identity:identity number:endidentityname:Enter Your
identity:identity number:endidentityname:Enter Your


The follow method try read from "display.txt" char by char until end of file.
for this proposal i perform casting: (char)in.read()
my problem is how method knows where is the end of file
while((c = (char)in.read()) != "????what suppose be here?????" )

kindly see method bellow:

File inputFile = new File("C:/ADELANTE/divelog/src/divelog/display.txt");

   public void MeabedFile()
        {
           try
         {
          char c;
          FileReader in = new FileReader(inputFile);      
          while((c = (char)in.read()) != "????what suppose be here????" )
          {
             System.out.print(c);
          }
                                       in.close();
         }
         catch (IOException e)
         {   
         }
        }
         

:banghead: :banghead: :banghead: :banghead:



Post a reply
  Related Posts  to : casting to char + end of file
 File read by char     -  
 convert char*(number) to required unsigned char*     -  
 Casting Variables in php     -  
 Array Casting in java     -  
 Set Implode char     -  
 Draw char with color in php     -  
 String char count     -  
 range of the char type     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 Copy file to file in java code- implementation     -