Class ByteUtils

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean match​(byte[] data, byte[] pattern)
      Sucht in einem Bytearray nach einem Bytearray.
      static byte[] readFromFile​(java.lang.String filename)  
      static byte[] readFromResource​(java.lang.String name)  
      static byte[] readFromResource​(java.lang.String name, int buffersize)  
      static byte[] readFromStream​(java.io.InputStream is)
      Liest ein komplettes Bytearray aus einem Stream und schliesst ihn.
      static byte[] readFromStream​(java.io.InputStream is, int buffersize)
      Liest ein komplettes Bytearray aus einem Stream und schliesst ihn.
      static void writeToFile​(java.lang.String filename, byte[] data)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • readFromStream

        public static byte[] readFromStream​(java.io.InputStream is)
                                     throws BMUException
        Liest ein komplettes Bytearray aus einem Stream und schliesst ihn.
        Parameters:
        is - InputStream
        Returns:
        byte[]
        Throws:
        BMUException - BMUException
      • readFromStream

        public static byte[] readFromStream​(java.io.InputStream is,
                                            int buffersize)
                                     throws BMUException
        Liest ein komplettes Bytearray aus einem Stream und schliesst ihn.
        Parameters:
        is - InputStream
        buffersize - int
        Returns:
        byte[]
        Throws:
        BMUException - BMUException
      • readFromResource

        public static byte[] readFromResource​(java.lang.String name,
                                              int buffersize)
                                       throws BMUException
        Parameters:
        name - String
        buffersize - int
        Returns:
        byte[]
        Throws:
        BMUException - BMUException
      • readFromResource

        public static byte[] readFromResource​(java.lang.String name)
                                       throws BMUException
        Parameters:
        name - String
        Returns:
        byte[]
        Throws:
        BMUException - BMUException
      • readFromFile

        public static byte[] readFromFile​(java.lang.String filename)
                                   throws BMUException
        Parameters:
        filename - String
        Returns:
        byte[]
        Throws:
        BMUException - BMUException
      • writeToFile

        public static void writeToFile​(java.lang.String filename,
                                       byte[] data)
                                throws BMUException
        Parameters:
        filename - String
        data - byte[]
        Throws:
        BMUException - BMUException
      • match

        public static boolean match​(byte[] data,
                                    byte[] pattern)
        Sucht in einem Bytearray nach einem Bytearray.
        Parameters:
        data - byte[]
        pattern - byte[]
        Returns:
        boolean