Class JavaUtils

java.lang.Object
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 Details

    • getBytesFromFile

      public static byte[] getBytesFromFile(String fileName) throws FileNotFoundException, IOException
      Method getBytesFromFile
      Parameters:
      fileName -
      Returns:
      the bytes readed 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 readed from the stream
      Throws:
      FileNotFoundException
      IOException