Code example for DataOutputStream

Methods: flush, writeChars

0
        dataOut.writeChars("screen_clear\n"); 
        dataOut.flush(); 
    } 
 
    public static void screen_clear(DataOutputStream dataOut, int y) throws IOException { 
        dataOut.writeChars("screen_clear " + y + "\n"); 
        dataOut.flush(); 
    } 
 
    /* 
     * Write parameters: 
     * - DataOutputStream -> output stream 
     * - String -> string to send 
     * - int -> x 
     * - int -> y 
     */ 
    public static void screen_write(DataOutputStream dataOut, String s, int x, int y) throws IOException { 
        s = s.replace(" ", "¤"); 
        dataOut.writeChars("screen_write " + s + " " + x + " " + y + "\n"); 
        dataOut.flush(); 
    }