Class SharedRandomContentInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, javax.mail.internet.SharedInputStream

    public class SharedRandomContentInputStream
    extends java.io.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 (Wed, 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected long calcFilePosition​(long nadd)  
      void close()  
      void closeAll()  
      protected long getFilePosition()  
      long getPosition()  
      void mark​(int readlimit)  
      java.io.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.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SharedRandomContentInputStream

        public SharedRandomContentInputStream​(org.apache.commons.vfs.FileObject fo)
                                       throws org.apache.commons.vfs.FileSystemException
        Throws:
        org.apache.commons.vfs.FileSystemException
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.BufferedInputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.BufferedInputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.BufferedInputStream
        Throws:
        java.io.IOException
      • getFilePosition

        protected long getFilePosition()
      • calcFilePosition

        protected long calcFilePosition​(long nadd)
      • mark

        public void mark​(int readlimit)
        Overrides:
        mark in class java.io.BufferedInputStream
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.BufferedInputStream
        Throws:
        java.io.IOException
      • getPosition

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

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.BufferedInputStream
        Throws:
        java.io.IOException
      • newStream

        public java.io.InputStream newStream​(long start,
                                             long end)
        Specified by:
        newStream in interface javax.mail.internet.SharedInputStream
      • closeAll

        public void closeAll()
                      throws java.io.IOException
        Throws:
        java.io.IOException