org.metasyntactic.io
Class IOUtilities

java.lang.Object
  |
  +--org.metasyntactic.io.IOUtilities

public class IOUtilities
extends java.lang.Object


Method Summary
static byte[] getBytes(java.io.InputStream in)
          Tries to read in the entire inputstream and return it in a single byte array.
static char[] getChars(java.io.Reader in)
          Tries to read in the entire reader and return it in a single char array.
static java.util.Iterator iterator(java.io.ObjectInputStream in)
          Returns a Iterator that returns Objects from this ObjectInputStream one at a time.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBytes

public static byte[] getBytes(java.io.InputStream in)
                       throws java.io.IOException
Tries to read in the entire inputstream and return it in a single byte array. WARNING!! If this stream never ends then this method will not return and you will run out of memory!

java.io.IOException

getChars

public static char[] getChars(java.io.Reader in)
                       throws java.io.IOException
Tries to read in the entire reader and return it in a single char array. WARNING!! If this reader never ends then this method will not return and you will run out of memory!

java.io.IOException

iterator

public static java.util.Iterator iterator(java.io.ObjectInputStream in)
Returns a Iterator that returns Objects from this ObjectInputStream one at a time. Note! This method only works on ObjectStreams that do NOT have primitives written to them. Also, the iterator will throw an UnsupportedOperationException if you attempt to call 'remove'.


main

public static void main(java.lang.String[] args)