public class RConsoleOutputStream extends OutputStream
Note that stdout/stderr are not connected to the R console by default, so one way of using this stream is to re-route Java output to R console:
System.setOut(new PrintStream(new RConsoleOutputStream(engine, 0))); System.setErr(new PrintStream(new RConsoleOutputStream(engine, 1)));
| Constructor and Description |
|---|
RConsoleOutputStream(Rengine eng,
int oType)
opens a new output stream to R console
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
flushpublic RConsoleOutputStream(Rengine eng, int oType)
eng - R engineoType - output type (0=regular, 1=error/warning)public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2017. All rights reserved.