try {
Pipe pipe = Pipe.open();
RubyIO source = new RubyIO(runtime, pipe.source());
source.setEncodingFromOptions(EncodingOption.getEncodingOptionFromString(runtime, modes.toString()));
RubyIO sink = new RubyIO(runtime, pipe.sink());
// Encoding ascii8bit = context.runtime.getEncodingService().getAscii8bitEncoding();
// sink.setupReadWriteEncodings(context, ascii8bit, ascii8bit);
sink.openFile.getMainStreamSafe().setSync(true);