/** * Creates and returns a new output stream which may be used to write to this console. * A console may be connected to more than one output stream at once. Clients are * responsible for closing any output streams created on this console. * <p> * Clients should avoid writing large amounts of output to this stream in the UI * thread. The console needs to process the output in the UI thread and if the client * hogs the UI thread writing output to the console, the console will not be able * to process the output. * </p> * @return a new output stream connected to this console */ public IOConsoleOutputStream newOutputStream() { IOConsoleOutputStream outputStream = new IOConsoleOutputStream(this); outputStream.setEncoding(fEncoding); synchronized(openStreams) { openStreams.add(outputStream); } return outputStream; }
/** * Creates and returns a new output stream which may be used to write to this console. * A console may be connected to more than one output stream at once. Clients are * responsible for closing any output streams created on this console. * <p> * Clients should avoid writing large amounts of output to this stream in the UI * thread. The console needs to process the output in the UI thread and if the client * hogs the UI thread writing output to the console, the console will not be able * to process the output. * </p> * @return a new output stream connected to this console */ public IOConsoleOutputStream newOutputStream() { IOConsoleOutputStream outputStream = new IOConsoleOutputStream(this); outputStream.setEncoding(fEncoding); synchronized(openStreams) { openStreams.add(outputStream); } return outputStream; }