// to the isolate via a link message. Note that the 4th one is the command
// shell's error stream!!
// if (ios.length > 3) {
// throw new RuntimeException("> 3 CommandIOs not implemented yet");
// }
StreamBindings streamBindings = new StreamBindings();
Closeable in = ios[Command.STD_IN].findBaseStream();
if (in instanceof FileInputStream) {
streamBindings.setIn((FileInputStream) in);
} else {
streamBindings.setIn(createSocketForInput(in));
}
Closeable out = ios[Command.STD_OUT].findBaseStream();
if (out instanceof FileOutputStream) {
streamBindings.setOut((FileOutputStream) out);
} else {
streamBindings.setOut(createSocketForOutput(out));
}
Closeable err = ios[Command.STD_ERR].findBaseStream();
if (err instanceof FileOutputStream) {
streamBindings.setErr((FileOutputStream) err);
} else {
streamBindings.setErr(createSocketForOutput(err));
}
return streamBindings;
}