Momentary elation: Channels

If you’ve been following my lamenting over NIO and SSL then you can probably guess that I’ve made it to step 5 (acceptance). I had a moment of elation this morning when I found another one of those obscure NIO classes: Channels. Channels does various conversions between traditional IO streams and NIO channels. In theory I could take SSLSocket‘s getInputStream() and get a ReadableByteChannel. One problem: ReadableByteChannel is not selectable. Oh well, back to the drawing board.

First grieveing and now momentary elation followed by good swift kick in the gut. Doesn’t Sun care about the unstable mental state all of this has left me in?!?

Side note: isn’t it annoying that there’s no interface that describes a selectable, readable / writeable channel? In other words, there’s no common way to describe a Pipe.SourceChannel and SocketChannel. Ppfth!

Advertisements

3 comments


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s