code: public static byte[] readBytes(File file) throws IOException {
          byte[] bytes = new byte[(int) file.length()];
          FileInputStream fileInputStream = new FileInputStream(file);
          DataInputStream dis = new DataInputStream(fileInputStream);
          try {
              dis.readFully(bytes);
              InputStream temp = dis;
              dis = null;
              temp.close();
          } finally {
              closeWithWarning(dis);
          }
          return bytes;
      }
docs: Reads the content of the file into a byte array.
  
  @param file a File
  @return a byte array with the contents of the file.
  @throws IOException if an IOException occurs.
  @since 1.0