/** * Ensure buffer is ready for reading, flushing remaining writes if required * @throws IOException */ private void ensureReadNonBuffered() throws IOException, BadDescriptorException { if (reading) { if (buffer.hasRemaining()) { Ruby localRuntime = getRuntime(); if (localRuntime != null) { throw localRuntime.newIOError("sysread for buffered IO"); } else { throw new IOException("sysread for buffered IO"); } } } else { // libc flushes writes on any read from the actual file, so we flush here flushWrite(); buffer.clear(); buffer.flip(); reading = true; } }
/** * Ensure buffer is ready for reading, flushing remaining writes if required * @throws IOException */ private void ensureReadNonBuffered() throws IOException, BadDescriptorException { if (reading) { if (buffer.hasRemaining()) { Ruby localRuntime = getRuntime(); if (localRuntime != null) { throw localRuntime.newIOError("sysread for buffered IO"); } else { throw new IOException("sysread for buffered IO"); } } } else { // libc flushes writes on any read from the actual file, so we flush here flushWrite(); buffer.clear(); buffer.flip(); reading = true; } }
/** * Ensure buffer is ready for reading, flushing remaining writes if required * @throws IOException */ private void ensureReadNonBuffered() throws IOException, BadDescriptorException { if (reading) { if (buffer.hasRemaining()) { Ruby localRuntime = getRuntime(); if (localRuntime != null) { throw localRuntime.newIOError("sysread for buffered IO"); } else { throw new IOException("sysread for buffered IO"); } } } else { // libc flushes writes on any read from the actual file, so we flush here flushWrite(); buffer.clear(); buffer.flip(); reading = true; } }
/** * Ensure buffer is ready for reading, flushing remaining writes if required * @throws IOException */ private void ensureReadNonBuffered() throws IOException, BadDescriptorException { if (reading) { if (buffer.hasRemaining()) { Ruby localRuntime = getRuntime(); if (localRuntime != null) { throw localRuntime.newIOError("sysread for buffered IO"); } else { throw new IOException("sysread for buffered IO"); } } } else { // libc flushes writes on any read from the actual file, so we flush here flushWrite(); buffer.clear(); buffer.flip(); reading = true; } }
/** * Closes IO handler resources. * * @throws IOException * @throws BadDescriptorException */ public void fclose() throws IOException, BadDescriptorException { try { synchronized (this) { closedExplicitly = true; close(); // not closing from finalize } } finally { Ruby localRuntime = getRuntime(); // Make sure we remove finalizers while not holding self lock, // otherwise there is a possibility for a deadlock! if (localRuntime != null) localRuntime.removeInternalFinalizer(this); // clear runtime so it doesn't get stuck in memory (JRUBY-2933) runtime = null; } }
/** * Closes IO handler resources. * * @throws IOException * @throws BadDescriptorException */ public void fclose() throws IOException, BadDescriptorException { try { synchronized (this) { closedExplicitly = true; close(); // not closing from finalize } } finally { Ruby localRuntime = getRuntime(); // Make sure we remove finalizers while not holding self lock, // otherwise there is a possibility for a deadlock! if (localRuntime != null) localRuntime.removeInternalFinalizer(this); // clear runtime so it doesn't get stuck in memory (JRUBY-2933) runtime = null; } }
/** * Closes IO handler resources. * * @throws IOException * @throws BadDescriptorException */ public void fclose() throws IOException, BadDescriptorException { try { synchronized (this) { closedExplicitly = true; close(); // not closing from finalize } } finally { Ruby localRuntime = getRuntime(); // Make sure we remove finalizers while not holding self lock, // otherwise there is a possibility for a deadlock! if (localRuntime != null) localRuntime.removeInternalFinalizer(this); // clear runtime so it doesn't get stuck in memory (JRUBY-2933) runtime = null; } }
/** * Closes IO handler resources. * * @throws IOException * @throws BadDescriptorException */ public void fclose() throws IOException, BadDescriptorException { try { synchronized (this) { closedExplicitly = true; close(); // not closing from finalize } } finally { Ruby localRuntime = getRuntime(); // Make sure we remove finalizers while not holding self lock, // otherwise there is a possibility for a deadlock! if (localRuntime != null) localRuntime.removeInternalFinalizer(this); // clear runtime so it doesn't get stuck in memory (JRUBY-2933) runtime = null; } }
if (getRuntime() != null) { throw getRuntime().newIOError("File too large"); } else { throw new IOException("File too large");
if (getRuntime() != null) { throw getRuntime().newIOError("File too large"); } else { throw new IOException("File too large");
if (getRuntime() != null) { throw getRuntime().newIOError("File too large"); } else { throw new IOException("File too large");
if (getRuntime() != null) { throw getRuntime().newIOError("File too large"); } else { throw new IOException("File too large");