Joram 5.0.6

org.objectweb.joram.shared.stream
Class StreamUtil

java.lang.Object
  extended by org.objectweb.joram.shared.stream.StreamUtil

public final class StreamUtil
extends java.lang.Object


Field Summary
static int FALSE
           
static int TRUE
           
 
Constructor Summary
StreamUtil()
           
 
Method Summary
static boolean[] readArrayOfBooleanFrom(java.io.InputStream is)
          This method allows to restore a boolean array from the input stream.
static int[] readArrayOfIntFrom(java.io.InputStream is)
          This method allows to restore a int array from the input stream.
static java.lang.String[] readArrayOfStringFrom(java.io.InputStream is)
          This method allows to restore a String array from the input stream.
static boolean readBooleanFrom(java.io.InputStream is)
          This method allows to restore a boolean from the input stream.
static byte[] readByteArrayFrom(java.io.InputStream is)
          This method allows to restore a byte array from the input stream.
static byte readByteFrom(java.io.InputStream is)
          This method allows to restore a byte from the input stream.
static double readDoubleFrom(java.io.InputStream is)
          This method allows to restore a double from the input stream.
static float readFloatFrom(java.io.InputStream is)
          This method allows to restore a float from the input stream.
static int readIntFrom(java.io.InputStream is)
          This method allows to restore an integer from the input stream.
static java.util.Properties readJPropertiesFrom(java.io.InputStream is)
          This method allows to restore a java.util.Properties object from the input stream.
static long readLongFrom(java.io.InputStream is)
          This method allows to restore a long from the input stream.
static java.lang.Object readObjectFrom(java.io.InputStream is)
          This method allows to restore an object from the input stream.
static Properties readPropertiesFrom(java.io.InputStream is)
          This method allows to restore a Properties object from the input stream.
static short readShortFrom(java.io.InputStream is)
          This method allows to restore a short from the input stream.
static java.lang.String readStringFrom(java.io.InputStream is)
          This method allows to restore a String from the input stream.
static java.util.Vector readVectorOfStringFrom(java.io.InputStream is)
          This method allows to restore a vector of String objects from the input stream.
static void writeArrayOfBooleanTo(boolean[] array, java.io.OutputStream os)
          This method allows to write a boolean array to the output stream.
static void writeArrayOfIntTo(int[] array, java.io.OutputStream os)
          This method allows to write a int array to the output stream.
static void writeArrayOfStringTo(java.lang.String[] array, java.io.OutputStream os)
          This method allows to write a String array to the output stream.
static void writeObjectTo(java.lang.Object obj, java.io.OutputStream os)
          This method allows to write an object to the output stream.
static void writeTo(boolean b, java.io.OutputStream os)
          This method allows to write a boolean to the output stream.
static void writeTo(byte[] tab, java.io.OutputStream os)
          This method allows to write byte array to the output stream.
static void writeTo(byte b, java.io.OutputStream os)
          This method allows to write a byte to the output stream.
static void writeTo(double d, java.io.OutputStream os)
          This method allows to write a double to the output stream.
static void writeTo(float f, java.io.OutputStream os)
          This method allows to write a float to the output stream.
static void writeTo(int i, java.io.OutputStream os)
          This method allows to write an integer to the output stream.
static void writeTo(long l, java.io.OutputStream os)
          This method allows to write a long to the output stream.
static void writeTo(Properties p, java.io.OutputStream os)
          This method allows to write a Properties object to the output stream.
static void writeTo(java.util.Properties p, java.io.OutputStream os)
          This method allows to write a java.util.Properties object to the output stream.
static void writeTo(short s, java.io.OutputStream os)
          This method allows to write a short to the output stream.
static void writeTo(java.lang.String str, java.io.OutputStream os)
          This method allows to write a String to the output stream.
static void writeVectorOfStringTo(java.util.Vector v, java.io.OutputStream os)
          This method allows to write a vector of String objects to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRUE

public static final int TRUE
See Also:
Constant Field Values

FALSE

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

StreamUtil

public StreamUtil()
Method Detail

writeTo

public static void writeTo(boolean b,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a boolean to the output stream.

Parameters:
b - the boolean to write
os - the stream to write the object to
Throws:
java.io.IOException

readBooleanFrom

public static boolean readBooleanFrom(java.io.InputStream is)
                               throws java.io.IOException
This method allows to restore a boolean from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the boolean
Throws:
java.io.IOException

writeTo

public static void writeTo(byte b,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a byte to the output stream.

Parameters:
b - the byte to write
os - the stream to write the object to
Throws:
java.io.IOException

readByteFrom

public static byte readByteFrom(java.io.InputStream is)
                         throws java.io.IOException
This method allows to restore a byte from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the byte
Throws:
java.io.IOException

writeTo

public static void writeTo(short s,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a short to the output stream.

Parameters:
s - the short to write
os - the stream to write the object to
Throws:
java.io.IOException

readShortFrom

public static short readShortFrom(java.io.InputStream is)
                           throws java.io.IOException
This method allows to restore a short from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the short
Throws:
java.io.IOException

writeTo

public static void writeTo(int i,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write an integer to the output stream.

Parameters:
i - the integer to write
os - the stream to write the object to
Throws:
java.io.IOException

readIntFrom

public static int readIntFrom(java.io.InputStream is)
                       throws java.io.IOException
This method allows to restore an integer from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the integer
Throws:
java.io.IOException

writeTo

public static void writeTo(long l,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a long to the output stream.

Parameters:
l - the long to write
os - the stream to write the object to
Throws:
java.io.IOException

readLongFrom

public static long readLongFrom(java.io.InputStream is)
                         throws java.io.IOException
This method allows to restore a long from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the long
Throws:
java.io.IOException

writeTo

public static void writeTo(float f,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a float to the output stream.

Parameters:
f - the float to write
os - the stream to write the object to
Throws:
java.io.IOException

readFloatFrom

public static float readFloatFrom(java.io.InputStream is)
                           throws java.io.IOException
This method allows to restore a float from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the float
Throws:
java.io.IOException

writeTo

public static void writeTo(double d,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a double to the output stream.

Parameters:
d - the double to write
os - the stream to write the object to
Throws:
java.io.IOException

readDoubleFrom

public static double readDoubleFrom(java.io.InputStream is)
                             throws java.io.IOException
This method allows to restore a double from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the double
Throws:
java.io.IOException

writeTo

public static void writeTo(java.lang.String str,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a String to the output stream.

Parameters:
str - the String to write
os - the stream to write the object to
Throws:
java.io.IOException

readStringFrom

public static java.lang.String readStringFrom(java.io.InputStream is)
                                       throws java.io.IOException
This method allows to restore a String from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the String object or null
Throws:
java.io.IOException

writeTo

public static void writeTo(byte[] tab,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write byte array to the output stream.

Parameters:
tab - the byte array to write
os - the stream to write the object to
Throws:
java.io.IOException

readByteArrayFrom

public static byte[] readByteArrayFrom(java.io.InputStream is)
                                throws java.io.IOException
This method allows to restore a byte array from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the byte array object or null
Throws:
java.io.IOException

writeObjectTo

public static void writeObjectTo(java.lang.Object obj,
                                 java.io.OutputStream os)
                          throws java.io.IOException
This method allows to write an object to the output stream.

Parameters:
obj - the object to write
os - the stream to write the object to
Throws:
java.io.IOException

readObjectFrom

public static java.lang.Object readObjectFrom(java.io.InputStream is)
                                       throws java.io.IOException
This method allows to restore an object from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the object or null
Throws:
java.io.IOException

writeTo

public static void writeTo(Properties p,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a Properties object to the output stream.

Parameters:
p - the Properties object to write
os - the stream to write the object to
Throws:
java.io.IOException

readPropertiesFrom

public static Properties readPropertiesFrom(java.io.InputStream is)
                                     throws java.io.IOException
This method allows to restore a Properties object from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the Properties object or null
Throws:
java.io.IOException

writeVectorOfStringTo

public static void writeVectorOfStringTo(java.util.Vector v,
                                         java.io.OutputStream os)
                                  throws java.io.IOException
This method allows to write a vector of String objects to the output stream.

Parameters:
p - the Properties object to write
os - the stream to write the object to
Throws:
java.io.IOException

readVectorOfStringFrom

public static java.util.Vector readVectorOfStringFrom(java.io.InputStream is)
                                               throws java.io.IOException
This method allows to restore a vector of String objects from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the Properties object or null
Throws:
java.io.IOException

writeArrayOfStringTo

public static void writeArrayOfStringTo(java.lang.String[] array,
                                        java.io.OutputStream os)
                                 throws java.io.IOException
This method allows to write a String array to the output stream.

Parameters:
array - the String array to write
os - the stream to write to
Throws:
java.io.IOException

readArrayOfStringFrom

public static java.lang.String[] readArrayOfStringFrom(java.io.InputStream is)
                                                throws java.io.IOException
This method allows to restore a String array from the input stream.

Parameters:
is - the stream to read data from in order to restore the String array
Returns:
the String array or null
Throws:
java.io.IOException

writeArrayOfIntTo

public static void writeArrayOfIntTo(int[] array,
                                     java.io.OutputStream os)
                              throws java.io.IOException
This method allows to write a int array to the output stream.

Parameters:
array - the int array to write
os - the stream to write to
Throws:
java.io.IOException

readArrayOfIntFrom

public static int[] readArrayOfIntFrom(java.io.InputStream is)
                                throws java.io.IOException
This method allows to restore a int array from the input stream.

Parameters:
is - the stream to read data from in order to restore the int array
Returns:
the int array or null
Throws:
java.io.IOException

writeArrayOfBooleanTo

public static void writeArrayOfBooleanTo(boolean[] array,
                                         java.io.OutputStream os)
                                  throws java.io.IOException
This method allows to write a boolean array to the output stream.

Parameters:
array - the boolean array to write
os - the stream to write to
Throws:
java.io.IOException

readArrayOfBooleanFrom

public static boolean[] readArrayOfBooleanFrom(java.io.InputStream is)
                                        throws java.io.IOException
This method allows to restore a boolean array from the input stream.

Parameters:
is - the stream to read data from in order to restore the boolean array
Returns:
the boolean array or null
Throws:
java.io.IOException

writeTo

public static void writeTo(java.util.Properties p,
                           java.io.OutputStream os)
                    throws java.io.IOException
This method allows to write a java.util.Properties object to the output stream.

Parameters:
p - the java.util.Properties object to write
os - the stream to write the object to
Throws:
java.io.IOException

readJPropertiesFrom

public static java.util.Properties readJPropertiesFrom(java.io.InputStream is)
                                                throws java.io.IOException
This method allows to restore a java.util.Properties object from the input stream.

Parameters:
is - the stream to read data from in order to restore the object
Returns:
the java.util.Properties object or null
Throws:
java.io.IOException

Joram 5.0.6

Copyright © 2005 Scalagent - All rights reserved