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

## net.schmizz.sshj.common
Class SSHPacket

    java.lang.Object
      net.schmizz.sshj.common.Buffer<SSHPacket>
          net.schmizz.sshj.common.SSHPacket

    public class SSHPacket

extends Buffer<SSHPacket>

Nested Class Summary

Nested classes/interfaces inherited from class net.schmizz.sshj.common.Buffer
`Buffer.BufferException, Buffer.PlainBuffer`

Field Summary

Fields inherited from class net.schmizz.sshj.common.Buffer
`data, DEFAULT_SIZE, rpos, wpos`

Constructor Summary
`SSHPacket()`
`SSHPacket(byte[] data)`
`SSHPacket(int size)`
`SSHPacket(Message msg)` Constructs new buffer for the specified SSH packet and reserves the needed space (5 bytes) for the packet header.
`SSHPacket(SSHPacket p)`

Method Summary
`SSHPacket` `putMessageID(Message msg)` Writes a byte indicating the SSH message identifier
`Message` `readMessageID()` Reads an SSH byte and returns it as `Message`

Methods inherited from class net.schmizz.sshj.common.Buffer

`array, available, clear, compact, ensureAvailable, ensureCapacity, getCompactData, getNextPowerOf2, printHex, putBoolean, putBuffer, putByte, putBytes, putBytes, putMPInt, putMPInt, putPublicKey, putRawBytes, putRawBytes, putSensitiveString, putSignature, putString, putString, putString, putUInt32, putUInt64, readBoolean, readByte, readBytes, readMPInt, readMPIntAsBytes, readPublicKey, readRawBytes, readRawBytes, readString, readStringAsBytes, readUInt32, readUInt32AsInt, readUInt64, rpos, rpos, toString, wpos, wpos`

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

Constructor Detail

### SSHPacket

    public SSHPacket()

### SSHPacket

    public SSHPacket(int size)

### SSHPacket

    public SSHPacket(byte[] data)

### SSHPacket

    public SSHPacket(Message msg)

  Constructs new buffer for the specified SSH packet and reserves the needed space (5 bytes) for the packet header.

  Parameters:
    `msg` - the SSH command

### SSHPacket

    public SSHPacket(SSHPacket p)

Method Detail

### readMessageID

    public Message readMessageID()
                          throws Buffer.BufferException

  Reads an SSH byte and returns it as `Message`

  Returns:
    the message identifier
  Throws:
    `Buffer.BufferException`

### putMessageID

    public SSHPacket putMessageID(Message msg)

  Writes a byte indicating the SSH message identifier

  Parameters:
    `msg` - the identifier as a `Message` type
  Returns:
    this

Copyright © 2009-2011. All Rights Reserved.