# RemoteFile (sshj 0.4.0 API)
Date: 2011-06-06

## net.schmizz.sshj.sftp
Class RemoteFile

    java.lang.Object
      net.schmizz.sshj.sftp.RemoteResource
          net.schmizz.sshj.sftp.RemoteFile

All Implemented Interfaces:
  Closeable

    public class RemoteFile

extends RemoteResource

Nested Class Summary
`class` `RemoteFile.RemoteFileInputStream`
`class` `RemoteFile.RemoteFileOutputStream`

Field Summary

Fields inherited from class net.schmizz.sshj.sftp.RemoteResource
`handle, log, path, requester`

Constructor Summary
`RemoteFile(Requester requester, String path, String handle)`

Method Summary
`FileAttributes` `fetchAttributes()`
`RemoteFile.RemoteFileInputStream` `getInputStream()`
`int` `getOutgoingPacketOverhead()`
`RemoteFile.RemoteFileOutputStream` `getOutputStream()`
`long` `length()`
`int` `read(long fileOffset, byte[] to, int offset, int len)`
`void` `setAttributes(FileAttributes attrs)`
`void` `setLength(long len)`
`void` `write(long fileOffset, byte[] data, int off, int len)`

Methods inherited from class net.schmizz.sshj.sftp.RemoteResource
`close, getPath, newRequest, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### RemoteFile

    public RemoteFile(Requester requester,
                      String path,
                      String handle)

Method Detail

### getInputStream

    public RemoteFile.RemoteFileInputStream getInputStream()

### getOutputStream

    public RemoteFile.RemoteFileOutputStream getOutputStream()

### fetchAttributes

    public FileAttributes fetchAttributes()
                                   throws IOException

  Throws:
    `IOException`

### length

    public long length()
                throws IOException

  Throws:
    `IOException`

### setLength

    public void setLength(long len)
                   throws IOException

  Throws:
    `IOException`

### read

    public int read(long fileOffset,
                    byte[] to,
                    int offset,
                    int len)
             throws IOException

  Throws:
    `IOException`

### write

    public void write(long fileOffset,
                      byte[] data,
                      int off,
                      int len)
               throws IOException

  Throws:
    `IOException`

### setAttributes

    public void setAttributes(FileAttributes attrs)
                       throws IOException

  Throws:
    `IOException`

### getOutgoingPacketOverhead

    public int getOutgoingPacketOverhead()

Copyright © 2009-2011. All Rights Reserved.