Searched defs:channel (Results 1 - 19 of 19) sorted by relevance

/libcore/luni/src/main/java/java/nio/
H A DSelectionKeyImpl.java32 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) {
106 * Returns true if the channel for this key is connected. If the channel
110 return !(channel instanceo
[all...]
H A DPipeImpl.java62 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 DFileChannelImpl.java63 * 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);
185 * Non-API method to release a given lock on a file channel. Assumes that
H A DSelectorImpl.java123 @Override protected SelectionKey register(AbstractSelectableChannel channel, argument
125 if (!provider().equals(channel.provider())) {
130 SelectionKeyImpl selectionKey = new SelectionKeyImpl(channel, operations,
220 setPollFd(i++, ((FileDescriptorChannel) key.channel()).getFD(), eventMask, key);
H A DSocketChannelImpl.java93 * Constructor for creating a connected socket channel.
100 * Constructor for creating an optionally connected socket channel.
218 // If the channel was not bound, a connection attempt will have caused an implicit bind() to
219 // take place. Keep the local address state held by the channel and the socket up to date.
224 // Keep the connected state held by the channel and the socket up to date.
485 /* @hide used by ServerSocketChannelImpl to sync channel state during accept() */
495 private final SocketChannelImpl channel; field in class:SocketChannelImpl.SocketAdapter
498 SocketAdapter(PlainSocketImpl socketImpl, SocketChannelImpl channel) argument
502 this.channel = channel;
585 private final SocketChannel channel; field in class:SocketChannelImpl.BlockingCheckOutputStream
587 BlockingCheckOutputStream(OutputStream out, SocketChannel channel) argument
630 private final SocketChannel channel; field in class:SocketChannelImpl.BlockingCheckInputStream
632 BlockingCheckInputStream(InputStream in, SocketChannel channel) argument
[all...]
/libcore/luni/src/main/java/java/nio/channels/
H A DFileLock.java44 * 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
112 public final FileChannel channel() { method in class:FileLock
[all...]
H A DSelectionKey.java20 * 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 DChannels.java42 * 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/spi/
H A DAbstractSelectionKeyTest.java56 public SelectableChannel channel() { method in class:AbstractSelectionKeyTest.MockSelectionKey
/libcore/luni/src/main/java/java/io/
H A DFileInputStream.java59 /** The unique file channel. Lazily initialized because it's rarely needed. */
60 private FileChannel channel; field in class:FileInputStream
115 if (channel != null) {
116 channel.close();
158 if (channel == null) {
159 channel = NioUtils.newFileChannel(this, fd, O_RDONLY);
161 return channel;
H A DFileOutputStream.java57 /** The unique file channel. Lazily initialized because it's rarely needed. */
58 private FileChannel channel; field in class:FileOutputStream
104 this.channel = NioUtils.newFileChannel(this, fd, mode);
134 if (channel != null) {
135 channel.close();
170 if (channel == null) {
171 channel = NioUtils.newFileChannel(this, fd, mode);
173 return channel;
H A DRandomAccessFile.java49 // The unique file channel associated with this FileInputStream (lazily
51 private FileChannel channel; field in class:RandomAccessFile
161 if (channel != null && channel.isOpen()) {
162 channel.close();
182 * The file channel's {@link FileChannel#position() position} is the same
185 * file channel's position and vice versa.
187 * Closing the channel closes the RandomAccessFile as well. The instance
191 * @return this file's file channel instance.
194 if(channel
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/channels/
H A DFileLockTest.java42 protected MockFileLock(FileChannel channel, long position, long size, argument
44 super(channel, position, size, shared);
77 assertNull(fileLock1.channel());
101 * @tests java.nio.channels.FileLock#channel()
104 assertSame(readWriteChannel, mockLock.channel());
106 assertNull(lock.channel());
H A DSelectionKeyTest.java69 public SelectableChannel channel() { method in class:SelectionKeyTest.MockSelectionKey
124 * @tests java.nio.channels.SelectionKey#channel()
127 assertSame(sc, selectionKey.channel());
130 assertSame(sc, selectionKey.channel());
H A DServerSocketChannelTest.java261 // socket close makes the channel close
277 // socket close makes the channel close
374 // so must close the server channel with another thread.
381 fail("Fail to close the server channel because of"
524 SocketChannel channel; field in class:ServerSocketChannelTest.WriteChannelThread
528 public WriteChannelThread(SocketChannel channel, ByteBuffer buffer) { argument
529 this.channel = channel;
535 channel.write(buffer);
536 channel
[all...]
/libcore/luni/src/main/java/java/nio/channels/spi/
H A DAbstractSelector.java63 * 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 DInterruptedStreamTest.java142 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 DFileIOInterruptTest.java402 // Now close the channel to see what happens.
530 private final FileChannel channel; field in class:FileIOInterruptTest.ChannelReader
536 ChannelReader(FileChannel channel, Method method) { argument
537 this.channel = channel;
547 channel.read(buffer);
550 channel.read(new ByteBuffer[] { buffer, buffer2 });
575 private final FileChannel channel; field in class:FileIOInterruptTest.ChannelWriter
581 ChannelWriter(FileChannel channel, Method method) { argument
582 this.channel
[all...]
H A DOldFileChannelTest.java503 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...]

Completed in 350 milliseconds