public void write(byte[] buffer) { if (sock != null && sock.isConnected()) { try { ou.write(buffer); ou.flush(); } catch(Exception e) {} } }
이렇게만 해도 됩니다. ou는 outputstream 이구여.