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();}}
public virtual void print(string str){lock (this){if (@out == null){setError();return;}if (str == null){print("null");return;}try{if (encoding == null){write(Sharpen.StringHelper.GetBytesForString(str));}else{write(Sharpen.StringHelper.GetBytesForString(str, encoding));}}catch (System.IO.IOException){setError();}}}