equal
deleted
inserted
replaced
185 /** |
185 /** |
186 * Returns an operation set identifying this channel's supported |
186 * Returns an operation set identifying this channel's supported |
187 * operations. |
187 * operations. |
188 * |
188 * |
189 * <p> Datagram channels support reading and writing, so this method |
189 * <p> Datagram channels support reading and writing, so this method |
190 * returns <tt>(</tt>{@link SelectionKey#OP_READ} <tt>|</tt> {@link |
190 * returns {@code (}{@link SelectionKey#OP_READ} {@code |} {@link |
191 * SelectionKey#OP_WRITE}<tt>)</tt>. </p> |
191 * SelectionKey#OP_WRITE}{@code )}. |
192 * |
192 * |
193 * @return The valid-operation set |
193 * @return The valid-operation set |
194 */ |
194 */ |
195 public final int validOps() { |
195 public final int validOps() { |
196 return (SelectionKey.OP_READ |
196 return (SelectionKey.OP_READ |
339 * <p> If a datagram is immediately available, or if this channel is in |
339 * <p> If a datagram is immediately available, or if this channel is in |
340 * blocking mode and one eventually becomes available, then the datagram is |
340 * blocking mode and one eventually becomes available, then the datagram is |
341 * copied into the given byte buffer and its source address is returned. |
341 * copied into the given byte buffer and its source address is returned. |
342 * If this channel is in non-blocking mode and a datagram is not |
342 * If this channel is in non-blocking mode and a datagram is not |
343 * immediately available then this method immediately returns |
343 * immediately available then this method immediately returns |
344 * <tt>null</tt>. |
344 * {@code null}. |
345 * |
345 * |
346 * <p> The datagram is transferred into the given byte buffer starting at |
346 * <p> The datagram is transferred into the given byte buffer starting at |
347 * its current position, as if by a regular {@link |
347 * its current position, as if by a regular {@link |
348 * ReadableByteChannel#read(java.nio.ByteBuffer) read} operation. If there |
348 * ReadableByteChannel#read(java.nio.ByteBuffer) read} operation. If there |
349 * are fewer bytes remaining in the buffer than are required to hold the |
349 * are fewer bytes remaining in the buffer than are required to hold the |
369 * |
369 * |
370 * @param dst |
370 * @param dst |
371 * The buffer into which the datagram is to be transferred |
371 * The buffer into which the datagram is to be transferred |
372 * |
372 * |
373 * @return The datagram's source address, |
373 * @return The datagram's source address, |
374 * or <tt>null</tt> if this channel is in non-blocking mode |
374 * or {@code null} if this channel is in non-blocking mode |
375 * and no datagram was immediately available |
375 * and no datagram was immediately available |
376 * |
376 * |
377 * @throws ClosedChannelException |
377 * @throws ClosedChannelException |
378 * If this channel is closed |
378 * If this channel is closed |
379 * |
379 * |