org.apache.sshd.common.util
Class Buffer

java.lang.Object
  extended by org.apache.sshd.common.util.Buffer

public final class Buffer
extends Object

TODO Add javadoc

Author:
Apache MINA SSHD Project

Nested Class Summary
static class Buffer.BufferException
           
 
Field Summary
static int DEFAULT_SIZE
           
 
Constructor Summary
Buffer()
           
Buffer(byte[] data)
           
Buffer(byte[] data, boolean read)
           
Buffer(byte[] data, int off, int len)
           
Buffer(byte[] data, int off, int len, boolean read)
           
Buffer(int size)
           
 
Method Summary
 byte[] array()
           
 int available()
           
 void clear()
           
 void compact()
           
 boolean getBoolean()
           
 byte getByte()
           
 byte[] getBytes()
           
 SshConstants.Message getCommand()
           
 byte[] getCompactData()
           
 int getInt()
           
 KeyPair getKeyPair()
           
 long getLong()
           
 BigInteger getMPInt()
           
 byte[] getMPIntAsBytes()
           
 PublicKey getPublicKey()
           
 void getRawBytes(byte[] buf)
           
 void getRawBytes(byte[] buf, int off, int len)
           
 PublicKey getRawPublicKey()
           
 String getString()
           
 byte[] getStringAsBytes()
           
 long getUInt()
           
 String printHex()
           
 void putBoolean(boolean b)
           
 void putBuffer(Buffer buffer)
           
 void putBuffer(org.apache.mina.core.buffer.IoBuffer buffer)
           
 void putByte(byte b)
           
 void putBytes(byte[] b)
           
 void putBytes(byte[] b, int off, int len)
           
 void putCommand(SshConstants.Message cmd)
           
 void putInt(long i)
          Writes 32 bits
 void putKeyPair(KeyPair key)
           
 void putLong(long i)
          Writes 64 bits
 void putMPInt(BigInteger bi)
           
 void putMPInt(byte[] foo)
           
 void putPublicKey(PublicKey key)
           
 void putRawBytes(byte[] d)
           
 void putRawBytes(byte[] d, int off, int len)
           
 void putRawPublicKey(PublicKey key)
           
 void putString(byte[] str)
           
 void putString(String string)
           
 int rpos()
           
 void rpos(int rpos)
           
 String toString()
           
 int wpos()
           
 void wpos(int wpos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SIZE

public static final int DEFAULT_SIZE
See Also:
Constant Field Values
Constructor Detail

Buffer

public Buffer()

Buffer

public Buffer(int size)

Buffer

public Buffer(byte[] data)

Buffer

public Buffer(byte[] data,
              boolean read)

Buffer

public Buffer(byte[] data,
              int off,
              int len)

Buffer

public Buffer(byte[] data,
              int off,
              int len,
              boolean read)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

rpos

public int rpos()

rpos

public void rpos(int rpos)

wpos

public int wpos()

wpos

public void wpos(int wpos)

available

public int available()

array

public byte[] array()

compact

public void compact()

getCompactData

public byte[] getCompactData()

clear

public void clear()

printHex

public String printHex()

getByte

public byte getByte()

getInt

public int getInt()

getUInt

public long getUInt()

getLong

public long getLong()

getBoolean

public boolean getBoolean()

getString

public String getString()

getStringAsBytes

public byte[] getStringAsBytes()

getMPInt

public BigInteger getMPInt()

getMPIntAsBytes

public byte[] getMPIntAsBytes()

getBytes

public byte[] getBytes()

getRawBytes

public void getRawBytes(byte[] buf)

getRawBytes

public void getRawBytes(byte[] buf,
                        int off,
                        int len)

getPublicKey

public PublicKey getPublicKey()
                       throws SshException
Throws:
SshException

getRawPublicKey

public PublicKey getRawPublicKey()
                          throws SshException
Throws:
SshException

getKeyPair

public KeyPair getKeyPair()
                   throws SshException
Throws:
SshException

getCommand

public SshConstants.Message getCommand()

putByte

public void putByte(byte b)

putBuffer

public void putBuffer(Buffer buffer)

putBuffer

public void putBuffer(org.apache.mina.core.buffer.IoBuffer buffer)

putInt

public void putInt(long i)
Writes 32 bits

Parameters:
i -

putLong

public void putLong(long i)
Writes 64 bits

Parameters:
i -

putBoolean

public void putBoolean(boolean b)

putBytes

public void putBytes(byte[] b)

putBytes

public void putBytes(byte[] b,
                     int off,
                     int len)

putString

public void putString(String string)

putString

public void putString(byte[] str)

putMPInt

public void putMPInt(BigInteger bi)

putMPInt

public void putMPInt(byte[] foo)

putRawBytes

public void putRawBytes(byte[] d)

putRawBytes

public void putRawBytes(byte[] d,
                        int off,
                        int len)

putPublicKey

public void putPublicKey(PublicKey key)

putRawPublicKey

public void putRawPublicKey(PublicKey key)

putKeyPair

public void putKeyPair(KeyPair key)

putCommand

public void putCommand(SshConstants.Message cmd)


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.