L
Leonard
I want to read de characters in an array : ok but I want them to
display on the screen with OutputStreamWriter, but
nothing happens, what's wrong. I know there's a better way, but I want
to do it this way.
public class IO
{
public static void main (String[]args)
{
System.out.println("Geef een zin in");
Writer uitvoer = new OutputStreamWriter(System.out); //
streaming to screen
char[]buf = new char[250];
Reader invoer = new InputStreamReader(System.in);
try{
invoer.read(buf); //ok
uitvoer.write(buf); //nothing appear
}
catch(IOException ioe)
{
System.out.println("fout bij inlezen");
}
display on the screen with OutputStreamWriter, but
nothing happens, what's wrong. I know there's a better way, but I want
to do it this way.
public class IO
{
public static void main (String[]args)
{
System.out.println("Geef een zin in");
Writer uitvoer = new OutputStreamWriter(System.out); //
streaming to screen
char[]buf = new char[250];
Reader invoer = new InputStreamReader(System.in);
try{
invoer.read(buf); //ok
uitvoer.write(buf); //nothing appear
}
catch(IOException ioe)
{
System.out.println("fout bij inlezen");
}