/libcore/luni/src/main/java/java/nio/ |
H A D | SelectionKeyImpl.java | 32 private AbstractSelectableChannel channel; field in class:SelectionKeyImpl 40 public SelectionKeyImpl(AbstractSelectableChannel channel, int operations, argument 42 this.channel = channel; 49 public SelectableChannel channel() { method in class:SelectionKeyImpl 50 return channel; 70 if ((operations & ~(channel().validOps())) != 0) { 104 * Returns true if the channel for this key is connected. If the channel 108 return !(channel instanceo [all...] |
H A D | PipeImpl.java | 62 private final SocketChannel channel; field in class:PipeImpl.PipeSourceChannel 67 this.channel = new SocketChannelImpl(selectorProvider, fd); 71 channel.close(); 79 return channel.read(buffer); 83 return channel.read(buffers); 87 return channel.read(buffers, offset, length); 97 private final SocketChannel channel; field in class:PipeImpl.PipeSinkChannel 102 this.channel = new SocketChannelImpl(selectorProvider, fd); 106 channel.close(); 114 return channel [all...] |
H A D | FileChannelImpl.java | 61 * Create a new file channel implementation class that wraps the given 140 public FileLockImpl(FileChannel channel, long position, long size, boolean shared) { argument 141 super(channel, position, size, shared); 145 return !isReleased && channel().isOpen(); 149 if (!channel().isOpen()) { 153 ((FileChannelImpl) channel()).release(this); 181 * Non-API method to release a given lock on a file channel. Assumes that
|
H A D | SelectorImpl.java | 119 @Override protected SelectionKey register(AbstractSelectableChannel channel, argument 121 if (!provider().equals(channel.provider())) { 126 SelectionKeyImpl selectionKey = new SelectionKeyImpl(channel, operations, 218 setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key);
|
H A D | SocketChannelImpl.java | 90 * Constructor for creating a connected socket channel. 97 * Constructor for creating an optionally connected socket channel. 475 private final SocketChannelImpl channel; field in class:SocketChannelImpl.SocketAdapter 478 SocketAdapter(PlainSocketImpl socketImpl, SocketChannelImpl channel) throws SocketException { argument 481 this.channel = channel; 491 return channel; 496 return channel.isBound; 501 return channel.isConnected(); 507 return channel 593 private final SocketChannel channel; field in class:SocketChannelImpl.SocketChannelOutputStream 595 SocketChannelOutputStream(SocketChannel channel) argument 636 private final SocketChannel channel; field in class:SocketChannelImpl.SocketChannelInputStream 638 SocketChannelInputStream(SocketChannel channel) argument [all...] |
/libcore/luni/src/main/java/java/nio/channels/ |
H A D | FileLock.java | 44 * closing the channel or exiting the process (terminating the VM). 62 * memory-mapped. On some platforms, closing a channel on a given file handle 65 * option here is to ensure that you only acquire locks on a single channel for 73 // The underlying file channel. 74 private final FileChannel channel; field in class:FileLock 86 * Constructs a new file lock instance for a given channel. The constructor 89 * @param channel 90 * the underlying file channel that holds the lock. 99 protected FileLock(FileChannel channel, long position, long size, boolean shared) { argument 103 this.channel 114 public final FileChannel channel() { method in class:FileLock [all...] |
H A D | SelectionKey.java | 20 * A {@code SelectionKey} represents the relationship between a channel and a 21 * selector for which the channel is registered. 24 * set represent categories of operations for a key's channel: Accepting socket 29 * {@link SelectableChannel channel} is interested in performing. 32 * {@code channel} is ready to execute. 106 * Gets the channel of this key. 108 * @return the channel of this key. 110 public abstract SelectableChannel channel(); method in class:SelectionKey 114 * only those bits set that are valid for this key's channel. 131 * key's channel [all...] |
H A D | Channels.java | 42 * Returns an input stream on the given channel. The resulting stream has 45 * <li>If the stream is closed, then the underlying channel is closed as 48 * <li>It throws an {@link IllegalBlockingModeException} if the channel is 54 * @param channel 55 * the channel to be wrapped by an InputStream. 56 * @return an InputStream that takes bytes from the given byte channel. 58 public static InputStream newInputStream(ReadableByteChannel channel) { argument 59 return new ChannelInputStream(channel); 63 * Returns an output stream on the given channel. The resulting stream has 66 * <li>If the stream is closed, then the underlying channel i 78 newOutputStream(WritableByteChannel channel) argument 129 newReader(ReadableByteChannel channel, CharsetDecoder decoder, int minBufferCapacity) argument 150 newReader(ReadableByteChannel channel, String charsetName) argument 171 newWriter(WritableByteChannel channel, CharsetEncoder encoder, int minBufferCapacity) argument 193 newWriter(WritableByteChannel channel, String charsetName) argument 206 private final ReadableByteChannel channel; field in class:Channels.ChannelInputStream 208 ChannelInputStream(ReadableByteChannel channel) argument 246 private final WritableByteChannel channel; field in class:Channels.ChannelOutputStream 248 ChannelOutputStream(WritableByteChannel channel) argument 277 checkBlocking(Channel channel) argument [all...] |
/libcore/luni/src/main/java/java/io/ |
H A D | FileInputStream.java | 61 /** The unique file channel. Lazily initialized because it's rarely needed. */ 62 private FileChannel channel; field in class:FileInputStream 117 if (channel != null) { 118 channel.close(); 160 if (channel == null) { 161 channel = NioUtils.newFileChannel(this, fd, O_RDONLY); 163 return channel;
|
H A D | FileOutputStream.java | 58 /** The unique file channel. Lazily initialized because it's rarely needed. */ 59 private FileChannel channel; field in class:FileOutputStream 105 this.channel = NioUtils.newFileChannel(this, fd, mode); 135 if (channel != null) { 136 channel.close(); 171 if (channel == null) { 172 channel = NioUtils.newFileChannel(this, fd, mode); 174 return channel;
|
H A D | RandomAccessFile.java | 50 // The unique file channel associated with this FileInputStream (lazily 52 private FileChannel channel; field in class:RandomAccessFile 162 if (channel != null && channel.isOpen()) { 163 channel.close(); 164 channel = null; 184 * The file channel's {@link FileChannel#position() position} is the same 187 * file channel's position and vice versa. 189 * @return this file's file channel instance. 192 if(channel [all...] |
/libcore/luni/src/main/java/java/nio/channels/spi/ |
H A D | AbstractSelector.java | 63 * Implements the closing of this channel. 84 * Returns this channel's set of canceled selection keys. 91 * Registers {@code channel} with this selector. 94 * channel}. 96 * @return the key related to the channel and this selector. 98 protected abstract SelectionKey register(AbstractSelectableChannel channel, argument 102 * Deletes the key from the channel's key set. 105 ((AbstractSelectableChannel) key.channel()).deregister(key);
|
/libcore/luni/src/test/java/libcore/java/io/ |
H A D | InterruptedStreamTest.java | 142 private void testInterruptReadableChannel(final ReadableByteChannel channel) throws Exception { argument 145 channel.read(ByteBuffer.allocate(BUFFER_SIZE)); 179 private void testInterruptWritableChannel(final WritableByteChannel channel) throws Exception { argument 184 channel.write(ByteBuffer.allocate(BUFFER_SIZE));
|
/libcore/luni/src/test/java/libcore/java/nio/channels/ |
H A D | OldFileChannelTest.java | 503 private void doTestForIOOBException(FileChannel channel, argument 506 channel.read(buffer, -1, 0); 512 channel.read(buffer, 0, -1); 518 channel.read(buffer, 0, 3); 524 channel.read(buffer, 1, 2); 530 channel.read(buffer, 2, 1); 536 channel.read(buffer, 3, 0); 645 FileChannel channel = out.getChannel(); 647 assertTrue("Assert 0: Channel is not open", channel.isOpen()); 649 assertFalse("Assert 0: Channel is still open", channel [all...] |