jcifs.smb
Class SmbFileInputStream
InputStream
jcifs.smb.SmbFileInputStream
public class SmbFileInputStream
extends InputStream
This InputStream can read bytes from a file on an SMB file server. Offsets are 64 bits.
SmbFileInputStream(String url) - Creates an
java.io.InputStream for reading bytes from a file on
an SMB server addressed by the url parameter.
|
SmbFileInputStream(SmbFile file) - Creates an
java.io.InputStream for reading bytes from a file on
an SMB server represented by the SmbFile parameter.
|
int | available() - This stream class is unbuffered.
|
void | close() - Closes this input stream and releases any system resources associated with the stream.
|
int | read() - Reads a byte of data from this input stream.
|
int | read(byte[] b) - Reads up to b.length bytes of data from this input stream into an array of bytes.
|
int | read(byte[] b, int off, int len) - Reads up to len bytes of data from this input stream into an array of bytes.
|
int | readDirect(byte[] b, int off, int len)
|
long | skip(long n) - Skip n bytes of data on this stream.
|
SmbFileInputStream
public SmbFileInputStream(String url)
throws SmbException,
MalformedURLException,
UnknownHostException
Creates an
java.io.InputStream
for reading bytes from a file on
an SMB server addressed by the
url
parameter. See
SmbFile
for a detailed description and examples of the smb
URL syntax.
url
- An smb URL string representing the file to read from
SmbFileInputStream
public SmbFileInputStream(SmbFile file)
throws SmbException,
MalformedURLException,
UnknownHostException
Creates an
java.io.InputStream
for reading bytes from a file on
an SMB server represented by the
SmbFile
parameter. See
SmbFile
for a detailed description and examples of
the smb URL syntax.
file
- An SmbFile
specifying the file to read from
available
public int available()
throws IOException
This stream class is unbuffered. Therefore this method will always
return 0 for streams connected to regular files. However, a
stream created from a Named Pipe this method will query the server using a
"peek named pipe" operation and return the number of available bytes
on the server.
close
public void close()
throws IOException
Closes this input stream and releases any system resources associated with the stream.
read
public int read()
throws IOException
Reads a byte of data from this input stream.
read
public int read(byte[] b)
throws IOException
Reads up to b.length bytes of data from this input stream into an array of bytes.
read
public int read(byte[] b,
int off,
int len)
throws IOException
Reads up to len bytes of data from this input stream into an array of bytes.
readDirect
public int readDirect(byte[] b,
int off,
int len)
throws IOException
skip
public long skip(long n)
throws IOException
Skip n bytes of data on this stream. This operation will not result
in any IO with the server. Unlink InputStream value less than
the one provided will not be returned if it exceeds the end of the file
(if this is a problem let us know).