Results 1 to 3 of 3
Thread: Really weird text writing O_o
- 11-22-2012, 01:24 AM #1
Senior Member
- Join Date
- Nov 2012
- Posts
- 105
- Rep Power
- 0
Really weird text writing O_o
ends up writing a bunch of random symbols I've never seen before instead of the numbers, and the output is just a bunch of question marks, I have no idea what happened or how to fix it. O_oJava Code:import java.io.*; public class Test{ public static void main(String args[]){ try{ byte bWrite [] = {11,21,3,40,5}; OutputStream os = new FileOutputStream("C:/Users/Darkzombies/Desktop/JavaStuff/test.txt"); for(int x=0; x < bWrite.length ; x++){ os.write( bWrite[x] ); // writes the bytes } os.close(); InputStream is = new FileInputStream("C:/Users/Darkzombies/Desktop/JavaStuff/test.txt"); int size = is.available(); for(int i=0; i< size; i++){ System.out.print((char)is.read() + " "); } is.close(); }catch(IOException e){ System.out.print("Exception"); } } }
- 11-22-2012, 01:31 AM #2
- 11-22-2012, 01:36 AM #3
Senior Member
- Join Date
- Nov 2012
- Posts
- 105
- Rep Power
- 0
Similar Threads
-
BlueJ help! weird error text meesed up
By linux1man in forum Other IDEsReplies: 6Last Post: 02-07-2013, 03:54 PM -
Reading from a text file, then writing back to Text Area in Reverse
By medic642 in forum New To JavaReplies: 8Last Post: 07-17-2011, 02:38 PM -
Writing Text To A File
By loopsnhoops in forum New To JavaReplies: 15Last Post: 06-01-2011, 03:27 AM -
Im writing to a file and i want to skip lines while writing to a text file.
By Broden_McDonald in forum New To JavaReplies: 1Last Post: 02-27-2010, 01:29 AM -
writing text to file
By notwist in forum New To JavaReplies: 3Last Post: 04-25-2008, 04:20 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks