edu.vt.middleware.crypt.io
Class IOHelper

java.lang.Object
  extended by edu.vt.middleware.crypt.io.IOHelper

public final class IOHelper
extends Object

Utility class with methods for common IO operations.

Version:
$Revision: 2744 $
Author:
Middleware Services

Method Summary
static byte[] read(FileChannel channel)
          Reads all data from the given file channel.
static byte[] read(InputStream in)
          Reads all data from a stream of unknown length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public static byte[] read(InputStream in)
                   throws IOException
Reads all data from a stream of unknown length.

Parameters:
in - Input stream to read.
Returns:
Entire contents of stream.
Throws:
IOException - On read errors.

read

public static byte[] read(FileChannel channel)
                   throws IOException
Reads all data from the given file channel. The channel is closed upon completion.

Parameters:
channel - File channel to read.
Returns:
Entire contents of channel.
Throws:
IOException - On read errors.


Copyright © 2003-2013 Virginia Tech. All Rights Reserved.