< prev index next >

src/java.base/share/classes/java/nio/channels/DatagramChannel.java

Print this page

        

*** 517,526 **** --- 517,528 ---- * there are more bytes in the datagram than remain in the given buffer * then the remainder of the datagram is silently discarded. Otherwise * this method behaves exactly as specified in the {@link * ReadableByteChannel} interface. </p> * + * @return The number of bytes read, possibly zero + * * @throws NotYetConnectedException * If this channel's socket is not connected */ public abstract int read(ByteBuffer dst) throws IOException;
*** 532,541 **** --- 534,545 ---- * there are more bytes in the datagram than remain in the given buffers * then the remainder of the datagram is silently discarded. Otherwise * this method behaves exactly as specified in the {@link * ScatteringByteChannel} interface. </p> * + * @return The number of bytes read, possibly zero + * * @throws NotYetConnectedException * If this channel's socket is not connected */ public abstract long read(ByteBuffer[] dsts, int offset, int length) throws IOException;
*** 548,557 **** --- 552,563 ---- * there are more bytes in the datagram than remain in the given buffers * then the remainder of the datagram is silently discarded. Otherwise * this method behaves exactly as specified in the {@link * ScatteringByteChannel} interface. </p> * + * @return The number of bytes read, possibly zero + * * @throws NotYetConnectedException * If this channel's socket is not connected */ public final long read(ByteBuffer[] dsts) throws IOException { return read(dsts, 0, dsts.length);
< prev index next >