SelectableChannel « nio « Java I/O Q&A

Home
Java I/O Q&A
1.API
2.batch File
3.binary File
4.class file
5.CSV file
6.deploy
7.Development
8.directory
9.error
10.Excel File
11.File Attribute
12.jar
13.Log
14.Media File
15.nio
16.Operation
17.PDF file
18.PropertyFile
19.serialize
20.text file
21.Windows
22.XML file
23.Zip
Java I/O Q&A » nio » SelectableChannel 

1. How do I define my own SelectableChannel?    stackoverflow.com

How would I define a new type of java.nio.channels.SelectableChannel (say for serial ports)?

2. NIO Best Practices - SelectableChannel and InterestOps    stackoverflow.com

using java.nio one has to register interest in operations via the SelectableChannel:

SelectionKey = SelectableChannel.register(selector, interestInOpsBitmask)
Registering Interest:
  • overwriting the existing SelectionKey by executing SelectableChannel.register with new Ops
  • VS. updating the existing SelectionKey with key.interestOps(key.interestOps() ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.