Code example for ObjectOutputStream

Methods: flushwriteUTF

0
} 
public void run(){ 
	try{ 
		username = (String)inMessageStream.readObject();
		if(username == "sgamerv" || username == "terry"){
			outMessageStream.writeUTF("Login Successful!!");
			outMessageStream.flush();
			System.out.println(username+" login successful!!");
		} 
	}catch(Exception ex){
		ex.printStackTrace();
	} 
} 
} 
Contextual code suggestions in your IDE  Get Codota for Java