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.
|