Class FSPInputStream

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable

    
    public class FSPInputStream
    extends InputStream
                        

    This class allows reading file from FSP server.

    Since:

    1.0

    Author:

    Radim Kolar

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      FSPInputStream(FSPsession session, String filename) creates a new Input stream for reading file from FSP server
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int available() returns the number of bytes that can be read from this input stream without contacting server.
      void close() frees internal buffers.
      synchronized void mark(int readlimit) marks current position in the stream.
      synchronized void reset() Repositions this stream to the position at the time the mark method was last called on this input stream.
      boolean markSupported() returns true - mark is supported.
      int read() reads next byte from stream or -1 if EOF
      int read(Array<byte> b, int off, int len) reads data from FSP stream
      long skip(long bytes) skips n bytes in input stream.
      • Methods inherited from class java.io.InputStream

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

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

      • FSPInputStream

        FSPInputStream(FSPsession session, String filename)

        creates a new Input stream for reading file from FSP server

        Parameters:
        session - open session to target server
        filename - filename for download
    • Method Detail

      • available

         int available()

        returns the number of bytes that can be read from this input stream without contacting server.

      • close

         void close()

        frees internal buffers. FSPsession is not closed.

      • mark

         synchronized void mark(int readlimit)

        marks current position in the stream.

        Parameters:
        readlimit - ignored
      • reset

         synchronized void reset()

        Repositions this stream to the position at the time the mark method was last called on this input stream.

        If no mark method was called, rewind stream to zero.

      • markSupported

         boolean markSupported()

        returns true - mark is supported.

      • read

         int read()

        reads next byte from stream or -1 if EOF

      • read

         int read(Array<byte> b, int off, int len)

        reads data from FSP stream

      • skip

         long skip(long bytes)

        skips n bytes in input stream.

        Parameters:
        bytes - number of bytes to be skipped
        Returns:

        0 on EOF or bytes

        Since:

        1.0