jcifs.smb
Class SmbFileInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--jcifs.smb.SmbFileInputStream
- public class SmbFileInputStream
- extends java.io.InputStream
This InputStream can read bytes from a file on an SMB file server. Offsets are 64 bits.
Constructor Summary |
SmbFileInputStream(SmbFile file)
Creates an InputStream for reading bytes from a file on
an SMB server represented by the SmbFile parameter. |
SmbFileInputStream(java.lang.String url)
Creates an InputStream for reading bytes from a file on
an SMB server addressed by the url parameter. |
Method Summary |
int |
available()
|
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. |
long |
skip(long n)
Skip n bytes of data on this stream. |
Methods inherited from class java.io.InputStream |
mark, markSupported, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SmbFileInputStream
public SmbFileInputStream(java.lang.String url)
throws SmbException,
java.net.MalformedURLException,
java.net.UnknownHostException
- Creates an
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.
- Parameters:
url
- An smb URL string representing the file to read from
SmbFileInputStream
public SmbFileInputStream(SmbFile file)
throws SmbException,
java.net.MalformedURLException,
java.net.UnknownHostException
- Creates an
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.
- Parameters:
url
- An smb URL string representing the file to write to
close
public void close()
throws java.io.IOException
- Closes this input stream and releases any system resources associated with the stream.
- Overrides:
close
in class java.io.InputStream
- Throws:
java.io.IOException
- if a network error occurs
read
public int read()
throws java.io.IOException
- Reads a byte of data from this input stream.
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
- if a network error occurs
read
public int read(byte[] b)
throws java.io.IOException
- Reads up to b.length bytes of data from this input stream into an array of bytes.
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
- if a network error occurs
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Reads up to len bytes of data from this input stream into an array of bytes.
- Overrides:
read
in class java.io.InputStream
- Throws:
java.io.IOException
- if a network error occurs
available
public int available()
throws java.io.IOException
- Overrides:
available
in class java.io.InputStream
skip
public long skip(long n)
throws java.io.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).
- Overrides:
skip
in class java.io.InputStream