Package java.nio.channels

Examples of java.nio.channels.ByteChannel


   * @return <code>true</code> if this object represents a valid
   * native file handle, <code>false</code> otherwise
   */
  public boolean valid ()
  {
    ByteChannel c = channel;
    return (c != null) && (c.isOpen());
  }
View Full Code Here


        session.setSelectionKey(ch.register(selector, SelectionKey.OP_READ, session));
    }

    @Override
    protected void destroy(NioSession session) throws Exception {
        ByteChannel ch = session.getChannel();
        SelectionKey key = session.getSelectionKey();
        if (key != null) {
            key.cancel();
        }
        ch.close();
    }
View Full Code Here

        session.setSelectionKey(ch.register(selector, SelectionKey.OP_READ, session));
    }

    @Override
    protected void destroy(NioSession session) throws Exception {
        ByteChannel ch = session.getChannel();
        SelectionKey key = session.getSelectionKey();
        if (key != null) {
            key.cancel();
        }
        ch.close();
    }
View Full Code Here

TOP

Related Classes of java.nio.channels.ByteChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.