// FIXME we should probably still be dyncalling 'write' here
RubyIO io = (RubyIO)maybeIO;
try {
OpenFile myOpenFile = io.getOpenFileChecked();
myOpenFile.checkWritable(context.runtime);
Stream writeStream = myOpenFile.getWriteStream();
writeStream.fputc(c);
if (myOpenFile.isSync()) myOpenFile.fflush(writeStream);
} catch (IOException ex) {
throw context.runtime.newIOErrorFromException(ex);
} catch (BadDescriptorException e) {
throw context.runtime.newErrnoEBADFError();