org.apache.commons.vfs.util
Class SharedRandomContentInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.BufferedInputStream
              extended by org.apache.commons.vfs.util.SharedRandomContentInputStream
All Implemented Interfaces:
Closeable, javax.mail.internet.SharedInputStream

public class SharedRandomContentInputStream
extends BufferedInputStream
implements javax.mail.internet.SharedInputStream

A wrapper to an FileObject to get a SharedInputStream

Version:
$Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100(mer, 29 nov 2006) $
Author:
imario@apache.org

Field Summary
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
SharedRandomContentInputStream(FileObject fo)
           
 
Method Summary
protected  long calcFilePosition(long nadd)
           
 void close()
           
 void closeAll()
           
protected  long getFilePosition()
           
 long getPosition()
           
 void mark(int readlimit)
           
 InputStream newStream(long start, long end)
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.BufferedInputStream
available, markSupported
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedRandomContentInputStream

public SharedRandomContentInputStream(FileObject fo)
                               throws FileSystemException
Throws:
FileSystemException
Method Detail

read

public int read()
         throws IOException
Overrides:
read in class BufferedInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class BufferedInputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class BufferedInputStream
Throws:
IOException

getFilePosition

protected long getFilePosition()

calcFilePosition

protected long calcFilePosition(long nadd)

mark

public void mark(int readlimit)
Overrides:
mark in class BufferedInputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class BufferedInputStream
Throws:
IOException

getPosition

public long getPosition()
Specified by:
getPosition in interface javax.mail.internet.SharedInputStream

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class BufferedInputStream
Throws:
IOException

newStream

public InputStream newStream(long start,
                             long end)
Specified by:
newStream in interface javax.mail.internet.SharedInputStream

closeAll

public void closeAll()
              throws IOException
Throws:
IOException


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.