Package org.apache.xml.security.utils
Class JavaUtils
- java.lang.Object
-
- org.apache.xml.security.utils.JavaUtils
-
public class JavaUtils extends java.lang.ObjectA collection of different, general-purpose methods for JAVA-specific things- Author:
- Christian Geuer-Pollmann
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]getBytesFromFile(java.lang.String fileName)Method getBytesFromFilestatic byte[]getBytesFromStream(java.io.InputStream inputStream)This method reads all bytes from the given InputStream till EOF and returns them as a byte array.static voidwriteBytesToFilename(java.lang.String filename, byte[] bytes)Method writeBytesToFilename
-
-
-
Method Detail
-
getBytesFromFile
public static byte[] getBytesFromFile(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOExceptionMethod getBytesFromFile- Parameters:
fileName-- Returns:
- the bytes readed from the file
- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
writeBytesToFilename
public static void writeBytesToFilename(java.lang.String filename, byte[] bytes)Method writeBytesToFilename- Parameters:
filename-bytes-
-
getBytesFromStream
public static byte[] getBytesFromStream(java.io.InputStream inputStream) throws java.io.IOExceptionThis method reads all bytes from the given InputStream till EOF and returns them as a byte array.- Parameters:
inputStream-- Returns:
- the bytes readed from the stream
- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
-