Skip to Content
Java in a Nutshell, 5th Edition
book

Java in a Nutshell, 5th Edition

by David Flanagan
March 2005
Intermediate to advanced
1254 pages
104h 21m
English
O'Reilly Media, Inc.
Content preview from Java in a Nutshell, 5th Edition

Name

Pipe.SourceChannel

Synopsis

This public inner class is represents the read end of a pipe. Bytes that are written to the corresponding write end of the pipe (see Pipe.SinkChannel) become available for reading through this channel. Obtain a Pipe.SourceChannel by creating a Pipe object with Pipe.open( ) and then calling the source( ) method of that object. See also the containing Pipe class.

Pipe.SourceChannel implements ReadableByteChannel and ScatteringByteChannel and defines the read( ) methods of those interfaces. This class subclasses SelectableChannel, so that it can be used with a Selector. It overrides the abstract validOps( ) method of SelectableChannel to return SelectionKey.OP_READ, but defines no new methods of its own.

public abstract static class Pipe.SourceChannel extends java.nio.channels.spi.
AbstractSelectableChannel implements ReadableByteChannel, ScatteringByteChannel {
// Protected Constructors
     protected SourceChannel(java.nio.channels.spi.SelectorProvider provider);  
// Public Methods Overriding SelectableChannel
     public final int validOps( );            constant
}

Returned By

Pipe.source( )

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java in a Nutshell, 8th Edition

Java in a Nutshell, 8th Edition

Benjamin J. Evans, Jason Clark, David Flanagan
Java in a Nutshell, 7th Edition

Java in a Nutshell, 7th Edition

Benjamin J. Evans, David Flanagan
Learning Java, 5th Edition

Learning Java, 5th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck
Learning Java, 4th Edition

Learning Java, 4th Edition

Patrick Niemeyer, Daniel Leuck

Publisher Resources

ISBN: 0596007736Supplemental ContentErrata Page