}
ChannelDescriptor main = new ChannelDescriptor(
inChannel,
getNewFileno(),
new FileDescriptor());
main.setCanBeSeekable(false);
openFile.setMainStream(new ChannelStream(getRuntime(), main));
registerDescriptor(main);
}
if (openFile.isWritable()) {
Channel outChannel;
if (process.getOutput() != null) {
// NIO-based
outChannel = process.getOutput();
} else {
outChannel = Channels.newChannel(process.getOutputStream());
}
ChannelDescriptor pipe = new ChannelDescriptor(
outChannel,
getNewFileno(),
new FileDescriptor());
pipe.setCanBeSeekable(false);
if (openFile.getMainStream() != null) {
openFile.setPipeStream(new ChannelStream(getRuntime(), pipe));
} else {