Package net.sf.fsp.fsplib
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
Radim Kolar
-
-
Constructor Summary
Constructors Constructor Description FSPInputStream(FSPsession session, String filename)creates a new Input stream for reading file from FSP server
-
Method Summary
Modifier and Type Method Description intavailable()returns the number of bytes that can be read from this input stream without contacting server. voidclose()frees internal buffers. synchronized voidmark(int readlimit)marks current position in the stream. synchronized voidreset()Repositions this stream to the position at the time the mark method was last called on this input stream. booleanmarkSupported()returns true - mark is supported. intread()reads next byte from stream or -1 if EOF intread(Array<byte> b, int off, int len)reads data from FSP stream longskip(long bytes)skips n bytes in input stream. -
-
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 serverfilename- 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
-
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
-
-
-
-