Interface PushSourceStream

public interface PushSourceStream
extends SourceStream

Fields inherited from interface
Method Summary
 int getMinimumTransferSize()
          Determine the size of the buffer needed for the data transfer.
 int read(byte[] buffer, int offset, int length)
          Read from the stream without blocking.
 void setTransferHandler(SourceTransferHandler transferHandler)
          Register an object to service data transfers to this stream.
Methods inherited from interface
endOfStream, getContentDescriptor, getContentLength
Methods inherited from interface
getControl, getControls

Method Detail


public int read(byte[] buffer,
                int offset,
                int length)
Read from the stream without blocking. Returns -1 when the end of the media is reached.
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.
The number of bytes read or -1 when the end of stream is reached.
Throws: - Thrown if an error occurs while reading


public int getMinimumTransferSize()
Determine the size of the buffer needed for the data transfer. This method is provided so that a transfer handler can determine how much data, at a minimum, will be available to transfer from the source. Overflow and data loss is likely to occur if this much data isn't read at transfer time.
The size of the data transfer.


public void setTransferHandler(SourceTransferHandler transferHandler)
Register an object to service data transfers to this stream.

If a handler is already registered when setTransferHandler is called, the handler is replaced; there can only be one handler at a time.

transferHandler - The handler to transfer data to.

Submit a bug or feature
Copyright 1994-2004 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.