ch.ethz.ssh2
Class SFTPInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by ch.ethz.ssh2.SFTPInputStream
All Implemented Interfaces:
Closeable

public class SFTPInputStream
extends InputStream

Version:
$Id:$

Constructor Summary
SFTPInputStream(SFTPv3FileHandle handle)
           
 
Method Summary
 void close()
           
 int read()
          Reads the next byte of data from the input stream.
 int read(byte[] buffer, int offset, int len)
          Reads up to len bytes of data from the input stream into an array of bytes.
 long skip(long n)
          Skips over and discards n bytes of data from this input stream.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SFTPInputStream

public SFTPInputStream(SFTPv3FileHandle handle)
Method Detail

read

public int read(byte[] buffer,
                int offset,
                int len)
         throws IOException
Reads up to len bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer.

Overrides:
read in class InputStream
Throws:
IOException
See Also:
SFTPv3Client.read(SFTPv3FileHandle,long,byte[],int,int)

read

public int read()
         throws IOException
Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

A subclass must provide an implementation of this method.

Specified by:
read in class InputStream
Returns:
the next byte of data, or -1 if the end of the stream is reached.
Throws:
IOException - if an I/O error occurs.

skip

public long skip(long n)
Skips over and discards n bytes of data from this input stream.

Overrides:
skip in class InputStream
Parameters:
n - the number of bytes to be skipped.
Returns:
the actual number of bytes skipped.

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException


Copyright © 2011. All Rights Reserved.