text: public synchronized void print(String str) {if (out == null) {setError();return;}if (str == null) {print("null");return;}try {if (encoding == null) {write(str.getBytes());} else {write(str.getBytes(encoding));}} catch (IOException e) {setError();}}