Expand|Select|Wrap|Line Numbers
- public void saveKeys()
- {
- String out = Integer.toString(left)+"\n"+Integer.toString(right)+"\n"+Integer.toString(up)+"\n"+Integer.toString(down)+"\n";
- try
- {
- PrintWriter save = new PrintWriter("key_selection.txt",out);
- }
- catch ( Exception e )
- {
- System.err.print(e);
- }
- }
Expand|Select|Wrap|Line Numbers
- java.io.UnsupportedEncodingException: 37
- 39
- 38
- 40
Expand|Select|Wrap|Line Numbers
- public void loadKeys()
- {
- try
- {
- FileInputStream fis = new FileInputStream("key_selection.txt");
- BufferedInputStream bis = new BufferedInputStream(fis);
- String in = "";
- while ( bis.read() > -1 )
- {
- in += (char)bis.read();
- }
- System.out.println(in);
- }
- catch ( Exception e )
- {
- System.err.println(e);
- }
- }
Expand|Select|Wrap|Line Numbers
- 7
- 9
- 8
What am I doing wrong? Please help!