James Moger
2012-11-25 c8b26c51aa67fc9345b624e36aab6f819e7eed74
src/com/gitblit/utils/FileUtils.java
@@ -99,6 +99,25 @@
      }
      return defaultValue;
   }
   /**
    * Returns the byte [] content of the specified file.
    *
    * @param file
    * @return the byte content of the file
    */
   public static byte [] readContent(File file) {
      byte [] buffer = new byte[(int) file.length()];
      try {
         BufferedInputStream is = new BufferedInputStream(new FileInputStream(file));
         is.read(buffer,  0,  buffer.length);
         is.close();
      } catch (Throwable t) {
         System.err.println("Failed to read byte content of " + file.getAbsolutePath());
         t.printStackTrace();
      }
      return buffer;
   }
   /**
    * Returns the string content of the specified file.