com.mindbright.ssh2
Class SSH2SFTP.SFTPPacket
java.lang.Object
com.mindbright.ssh2.SSH2DataBuffer
com.mindbright.ssh2.SSH2SFTP.SFTPPacket
- Enclosing class:
- SSH2SFTP
- protected static final class SSH2SFTP.SFTPPacket
- extends SSH2DataBuffer
Handles sftp data packets. Contains functions to read and write
the sftp types.
Methods inherited from class com.mindbright.ssh2.SSH2DataBuffer |
getData, getMaxReadSize, getMaxWriteSize, getRPos, getWPos, readBigInt, readBigIntBits, readBoolean, readByte, readInt, readJavaString, readRaw, readRaw, readRestRaw, readString, readString, reset, setData, setRPos, setWPos, writeBigInt, writeBigIntBits, writeBoolean, writeByte, writeInt, writeRaw, writeRaw, writeString, writeString, writeString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SSH2SFTP.SFTPPacket
public SSH2SFTP.SFTPPacket()
reset
public void reset(int type,
int id)
getType
public int getType()
getId
public int getId()
getLength
public int getLength()
writeLong
public void writeLong(long l)
readLong
public long readLong()
writeAttrs
public void writeAttrs(SSH2SFTP.FileAttributes attrs)
readAttrs
public SSH2SFTP.FileAttributes readAttrs()
failsafeReadFrom
public void failsafeReadFrom(java.io.InputStream in)
throws SSH2SFTP.SFTPException
- Failsafe read method. Tries to read a packet from the given stream.
but does ignore stuff which does not look like a packet. The
algorithm is that a probable packet starts with two bytes containing
zeros.
This is useful when reading the first version packet which is
small but may be, on broken systems, preceded by some ascii
characters.
- Parameters:
in
- Stream to read data from
- Throws:
SSH2SFTP.SFTPException
readFrom
public void readFrom(java.io.InputStream in)
throws SSH2SFTP.SFTPException
- Throws:
SSH2SFTP.SFTPException
writeTo
public void writeTo(java.io.OutputStream out)
throws SSH2SFTP.SFTPException
- Throws:
SSH2SFTP.SFTPException