oemware.core.util
Class IoUtils

java.lang.Object
  extended by oemware.core.util.IoUtils

public class IoUtils
extends java.lang.Object

The io utils.


Constructor Summary
IoUtils()
           
 
Method Summary
static int readInputStream(java.io.InputStream pInputStream, byte[] pBuffer, int pReadSize)
          Read the input stream into a byte array.
static byte[] readInputStream(java.io.InputStream pInputStream, int pReadSize)
          Read the input stream into a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoUtils

public IoUtils()
Method Detail

readInputStream

public static final byte[] readInputStream(java.io.InputStream pInputStream,
                                           int pReadSize)
                                    throws java.io.IOException
Read the input stream into a byte array. Be careful with this method. If the amount of data in the input stream is too much, you'll run out of memory. If an empty input stream is passed, an empty byte array is returned.

Parameters:
pInputStream - The stream.
pReadSize - The number of bytes to attempt to read at a time.
Returns:
The byte array containing all the data.
Throws:
java.io.IOException

readInputStream

public static final int readInputStream(java.io.InputStream pInputStream,
                                        byte[] pBuffer,
                                        int pReadSize)
                                 throws java.io.IOException
Read the input stream into a byte array. Make sure you're buffer is large enough or an exception will be thrown.

Parameters:
pInputStream - The stream.
pBuffer - The buffer.
pReadSize - The number of bytes to attempt to read at a time.
Returns:
The number of bytes read from the input stream.
Throws:
java.io.IOException


Copyright © 2009 Deft Labs - Released under LGPL, Version 3.0