FileDocCategorySizeDatePackage
ByteCountedInputStream.javaAPI DocAzureus 3.0.3.42135Fri Feb 09 08:45:38 GMT 2007com.aelitis.azureus.core.util

ByteCountedInputStream

public class ByteCountedInputStream extends FilterInputStream

Fields Summary
private long
position
private long
mark
Constructors Summary
public ByteCountedInputStream(InputStream is)

		super( is );
	
Methods Summary
public longgetPosition()

		return( position );
	
public synchronized voidmark(int readlimit)

		in.mark(readlimit);	
		
		mark	= position;
	
public intread()

		int	read = in.read();
		
		position += read;
		
		return( read );
	
public intread(byte[] b)

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

		int	read = in.read(b, off, len);
		
		position += read;
		
		return( read );
	
public synchronized voidreset()

		in.reset();	
		
		position = mark;
	
public longskip(long n)

		long	skipped = in.skip(n);
		
		position += skipped;
		
		return( skipped );