org.apache.xml.security.utils
Class JavaUtils

java.lang.Object
  extended by org.apache.xml.security.utils.JavaUtils

public class JavaUtils
extends Object

A collection of different, general-purpose methods for JAVA-specific things

Author:
Christian Geuer-Pollmann

Method Summary
static byte[] getBytesFromFile(String fileName)
          Method getBytesFromFile
static byte[] getBytesFromStream(InputStream inputStream)
          This method reads all bytes from the given InputStream till EOF and returns them as a byte array.
static void writeBytesToFilename(String filename, byte[] bytes)
          Method writeBytesToFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBytesFromFile

public static byte[] getBytesFromFile(String fileName)
                               throws FileNotFoundException,
                                      IOException
Method getBytesFromFile

Parameters:
fileName -
Returns:
the bytes read from the file
Throws:
FileNotFoundException
IOException

writeBytesToFilename

public static void writeBytesToFilename(String filename,
                                        byte[] bytes)
Method writeBytesToFilename

Parameters:
filename -
bytes -

getBytesFromStream

public static byte[] getBytesFromStream(InputStream inputStream)
                                 throws IOException
This method reads all bytes from the given InputStream till EOF and returns them as a byte array.

Parameters:
inputStream -
Returns:
the bytes read from the stream
Throws:
FileNotFoundException
IOException


Copyright © 2000–2013 The Apache Software Foundation. All rights reserved.