Secure iNet Factory

com.jscape.inet.ssh.types
Class SshString

java.lang.Object
  extended by com.jscape.inet.ssh.types.SshString

public final class SshString
extends java.lang.Object

SSH2 string. Strings are allowed to contain arbitrary binary data, including null characters and 8-bit characters. They are stored as a uint32 containing its length (number of bytes that follow) and zero (= empty string) or more bytes that are the value of the string. Terminating null characters are not used.

Version:
1.0
Author:
Alex Usun

Constructor Summary
SshString()
           
 
Method Summary
static byte[] readValue(java.io.InputStream in)
          Reads a value from the specified stream.
static java.lang.String readValue(java.io.InputStream in, java.lang.String charset)
           
static void writeValue(byte[] value, int off, int len, java.io.OutputStream out)
          Writes the specified value to the stream.
static void writeValue(byte[] value, java.io.OutputStream out)
          Writes the specified value to the stream.
static void writeValue(java.lang.String value, java.lang.String charset, java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SshString

public SshString()
Method Detail

readValue

public static byte[] readValue(java.io.InputStream in)
                        throws java.io.IOException
Reads a value from the specified stream.

Parameters:
in - input stream
Returns:
read value
Throws:
java.io.IOException - if a error occurs

readValue

public static java.lang.String readValue(java.io.InputStream in,
                                         java.lang.String charset)
                                  throws java.io.IOException
Throws:
java.io.IOException

writeValue

public static void writeValue(byte[] value,
                              java.io.OutputStream out)
                       throws java.io.IOException
Writes the specified value to the stream.

Parameters:
value - value to write
out - output stream
Throws:
java.io.IOException - if an error occurs

writeValue

public static void writeValue(byte[] value,
                              int off,
                              int len,
                              java.io.OutputStream out)
                       throws java.io.IOException
Writes the specified value to the stream.

Parameters:
value - value to write
off - value offset
len - value length
out - output stream
Throws:
java.io.IOException - if an error occurs

writeValue

public static void writeValue(java.lang.String value,
                              java.lang.String charset,
                              java.io.OutputStream out)
                       throws java.io.IOException
Throws:
java.io.IOException

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved