public void fflush(Stream stream) throws IOException, BadDescriptorException { while (true) { int n = stream.fflush(); if (n != -1) { break; } } mode &= ~WBUF; }
public void fflush(Stream stream) throws IOException, BadDescriptorException { while (true) { int n = stream.fflush(); if (n != -1) { break; } } mode &= ~WBUF; }
public int fflush() throws IOException, BadDescriptorException { return stream.fflush(); }
public int fflush() throws IOException, BadDescriptorException { return stream.fflush(); }
public int fflush() throws IOException, BadDescriptorException { return stream.fflush(); }
public int fflush() throws IOException, BadDescriptorException { return stream.fflush(); }
private static RubyIO getRubyIO(Ruby runtime, Writer writer) throws IOException, BadDescriptorException { PrintStream pstream = new PrintStream(new WriterOutputStream(writer), true); RubyIO io = new RubyIO(runtime, pstream, false); io.getOpenFile().getMainStreamSafe().setSync(true); io.getOpenFile().getMainStreamSafe().fflush(); return io; }
private static RubyIO getRubyIO(Ruby runtime, Writer writer) throws IOException, BadDescriptorException { PrintStream pstream = new PrintStream(new WriterOutputStream(writer), true); RubyIO io = new RubyIO(runtime, pstream, false); io.getOpenFile().getMainStreamSafe().setSync(true); io.getOpenFile().getMainStreamSafe().fflush(); return io; }
/** Flushes the IO output stream. * * @return The IO. */ @JRubyMethod(name = "flush") public RubyIO flush() { try { getOpenFileChecked().getWriteStream().fflush(); } catch (BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOErrorFromException(e); } return this; }
/** Flushes the IO output stream. * * @return The IO. */ @JRubyMethod(name = "flush") public RubyIO flush() { try { getOpenFileChecked().getWriteStream().fflush(); } catch (BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOErrorFromException(e); } return this; }
@JRubyMethod(name = "fsync") public RubyFixnum fsync(ThreadContext context) { Ruby runtime = context.runtime; try { OpenFile myOpenFile = getOpenFileChecked(); myOpenFile.checkWritable(runtime); Stream writeStream = myOpenFile.getWriteStream(); writeStream.fflush(); writeStream.sync(); } catch (InvalidValueException ex) { throw runtime.newErrnoEINVALError(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (BadDescriptorException e) { throw runtime.newErrnoEBADFError(); } return RubyFixnum.zero(runtime); }
@JRubyMethod(name = "fsync") public RubyFixnum fsync(ThreadContext context) { Ruby runtime = context.runtime; try { OpenFile myOpenFile = getOpenFileChecked(); myOpenFile.checkWritable(runtime); Stream writeStream = myOpenFile.getWriteStream(); writeStream.fflush(); writeStream.sync(); } catch (InvalidValueException ex) { throw runtime.newErrnoEINVALError(); } catch (IOException e) { throw runtime.newIOErrorFromException(e); } catch (BadDescriptorException e) { throw runtime.newErrnoEBADFError(); } return RubyFixnum.zero(runtime); }