< prev index next >

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

Print this page

        

@@ -517,10 +517,12 @@
      * 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,10 +534,12 @@
      * 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,10 +552,12 @@
      * 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 >