FileDocCategorySizeDatePackage
PullSourceStream2InputStream.javaAPI DocJMF 2.1.1e1635Mon May 12 12:21:04 BST 2003com.ibm.media.util

PullSourceStream2InputStream

public class PullSourceStream2InputStream extends InputStream
PullSourceStream2InputStream is an adaptor between a PullSourceStream and an InputStream. In receives in its constructor a PullSourceStream and uses that stream in order to implement the InputStream methods

Fields Summary
PullSourceStream
pss
The PullSourceStream to be used
byte[]
buffer
A byte array of size 1, for the read() method
Constructors Summary
public PullSourceStream2InputStream(PullSourceStream pss)
Constructor


          
       

	this.pss = pss;
    
Methods Summary
public intavailable()

    
	// NOT IMPLEMENTED
	System.out.println("available was called");
    
	return 0;
    
public voidclose()

    
	// DO NOTHING (???)
    
public booleanmarkSupported()

    
	return false;
    
public intread()


	if (pss.endOfStream()) {
	    System.out.println("end of stream");
	    return -1;
	}

	pss.read(buffer, 0, 1);
	return buffer[0];    
    
public intread(byte[] b)


	return pss.read(b, 0, b.length);
    
public intread(byte[] b, int off, int len)

    
	return pss.read(b, off, len);
    
public longskip(long n)

    
	byte[] buffer = new byte[(int)n];
	int read = read(buffer);

	return read;