Interface Receive


  • public interface Receive
    Used to receive data from the network channel. Any implementation of this interface can be used to read data from the network
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isReadComplete()
      Indicates if the read has been completed
      long readFrom​(java.nio.channels.ReadableByteChannel channel)
      Reads some bytes from the provided channel
    • Method Detail

      • isReadComplete

        boolean isReadComplete()
        Indicates if the read has been completed
        Returns:
        true if read is complete, else false
      • readFrom

        long readFrom​(java.nio.channels.ReadableByteChannel channel)
               throws java.io.IOException
        Reads some bytes from the provided channel
        Parameters:
        channel - The channel to read from
        Returns:
        Number of bytes read. Returns -1 if EOS is reached
        Throws:
        java.io.IOException