public void syncWrite(byte[] bytes) throws IOException {
        outputStream.write(bytes);
        outputStream.flush();
    }
Write data to the output stream while synchronized against close(). This hopefully fixes
sporadic test failures caused by a deadlock of write() and close()
@param bytes The data to write
@throws IOException if an error occurs
src/test/java/com/notnoop/apns/utils/Simulator/InputOutputSocket.java