All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface javax.media.protocol.PullSourceStream

public interface PullSourceStream
extends SourceStream
Abstracts a read interface that data is pulled from.

Version:
1.8, 97/08/23.
See Also:
PullDataSource

Method Index

 o read(byte[], int, int)
Block and read data from the stream.
 o willReadBlock()
Find out if data is available now.

Methods

 o willReadBlock
 public abstract boolean willReadBlock()
Find out if data is available now. Returns true if a call to read would block for data.

Returns:
Returns true if read would block; otherwise returns false.
 o read
 public abstract int read(byte buffer[],
                          int offset,
                          int length) throws IOException
Block and read data from the stream.

Reads up to length bytes from the input stream into an array of bytes. If the first argument is null, up to length bytes are read and discarded. Returns -1 when the end of the media is reached. This method only returns 0 if it was called with a length of 0.

Parameters:
buffer - The buffer to read bytes into.
offset - The offset into the buffer at which to begin writing data.
length - The number of bytes to read.
Returns:
The number of bytes read, -1 indicating the end of stream, or 0 indicating read was called with length 0.

All Packages  Class Hierarchy  This Package  Previous  Next  Index