public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { return delegate.transferFrom(src, position, count); }
public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { return channel.transferFrom(src, position, count); }
@Override public long transferTo(long count, ByteBuffer throughBuffer, StreamSinkChannel target) throws IOException { return target.transferFrom(this, count, throughBuffer); }
public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { return sink.transferFrom(src, position, count); }
public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { return delegate.transferFrom(source, count, throughBuffer); }
public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { return sink.transferFrom(source, count, throughBuffer); }
public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { return channel.transferFrom(source, count, throughBuffer); }
public long transferTo(final long position, final long count, final WritableByteChannel target) throws IOException { if (target instanceof StreamSinkChannel) { return ((StreamSinkChannel) target).transferFrom(delegate, position, count); } else { return delegate.transferTo(position, count, target); } }
@Override public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { if (isFinished()) { throw UndertowMessages.MESSAGES.channelIsClosed(); } return delegate.transferFrom(source, count, throughBuffer); }
/** * Transfer bytes between two channels efficiently, blocking if necessary. * * @param destination the destination channel * @param source the source file channel * @param startPosition the start position in the source file * @param count the number of bytes to transfer * @throws IOException if an I/O error occurs */ public static void transferBlocking(StreamSinkChannel destination, FileChannel source, long startPosition, final long count) throws IOException { long remaining = count; long res; while (remaining > 0L) { while ((res = destination.transferFrom(source, startPosition, remaining)) == 0L) { try { destination.awaitWritable(); } catch (InterruptedIOException e) { final long bytes = count - remaining; if (bytes > (long) Integer.MAX_VALUE) { e.bytesTransferred = -1; } else { e.bytesTransferred = (int) bytes; } } } remaining -= res; startPosition += res; } }
public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { if (allAreSet(state, FLAG_CLOSE_REQUESTED)) { throw new ClosedChannelException(); } if (count == 0L) return 0L; final long remaining = this.count; if (remaining == 0L) { throw msg.fixedOverflow(); } long res = 0L; try { return res = delegate.transferFrom(src, position, min(count, remaining)); } finally { this.count = remaining - res; } }
public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { if (allAreSet(state, FLAG_CLOSE_REQUESTED)) { throw new ClosedChannelException(); } if (count == 0L) return 0L; final long remaining = this.count; if (remaining == 0L) { throw msg.fixedOverflow(); } long res = 0L; try { return res = delegate.transferFrom(source, min(count, remaining), throughBuffer); } finally { this.count = remaining - res; } }
@Override public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { if (isFinished()) { throw UndertowMessages.MESSAGES.channelIsClosed(); } return delegate.transferFrom(src, position, count); }
long ret = dest.transferFrom(source, pos, size - pos); pos += ret; if (ret == 0) {
@Override public long transferTo(long count, ByteBuffer throughBuffer, StreamSinkChannel target) throws IOException { return target.transferFrom(this, count, throughBuffer); }
public long transferTo(final long position, final long count, final WritableByteChannel target) throws IOException { if (target instanceof StreamSinkChannel) { return ((StreamSinkChannel) target).transferFrom(delegate, position, count); } else { return delegate.transferTo(position, count, target); } }
@Override public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { if (isFinished()) { throw UndertowMessages.MESSAGES.channelIsClosed(); } return delegate.transferFrom(src, position, count); }
@Override public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { if (isFinished()) { throw UndertowMessages.MESSAGES.channelIsClosed(); } return delegate.transferFrom(source, count, throughBuffer); }
@Override public long transferFrom(final FileChannel src, final long position, final long count) throws IOException { if (isFinished()) { throw UndertowMessages.MESSAGES.channelIsClosed(); } return delegate.transferFrom(src, position, count); }
@Override public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException { if (isFinished()) { throw UndertowMessages.MESSAGES.channelIsClosed(); } return delegate.transferFrom(source, count, throughBuffer); }