Thread: Open text file
View Single Post
  #8   Spotlight this post!  
Unread 17-02-2012, 16:15
techkid86's Avatar
techkid86 techkid86 is offline
Magic Programer
FRC #3044 (0xBE4)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: ballston spa
Posts: 58
techkid86 is an unknown quantity at this point
Question Re: Open text file

we has this as code, but it only reads every other character.
ex.
in text file: 1234.5678
reads out: 2457

i have checked the character encoding, and it seems to be in ASCII. but, the read char is in Unicode. so i outputed the raw bytes, and converted it into ASCII, and the output just was the ASCII reprisentation.

DataInputStream dataStream=new DataInputStream("file:///FTPtest.txt");
char[] c=new char[9];
for (int i=0;i<9;i++)
{
c[i]=dataStream.readChar();
}
System.out.println(new String(c));


any suggestions?


found it.... nvm.... *face palm*
__________________
"you can build a perfect machine out of imperfect parts" -Urza

Last edited by techkid86 : 17-02-2012 at 18:12.
Reply With Quote