Buggy code:
public static File getFile ( String ... names ) { } public static String getTempDirectoryPath ( ) { } public static File getTempDirectory ( ) { } public static String getUserDirectoryPath ( ) { } public static File getUserDirectory ( ) { } public static FileInputStream openInputStream ( File file ) throws IOException { } public static FileOutputStream openOutputStream ( File file ) throws IOException { } public static FileOutputStream openOutputStream ( File file , boolean append ) throws IOException { } public static String byteCountToDisplaySize ( long size ) { } public static void touch ( File file ) throws IOException { } public static File [ ] convertFileCollectionToFileArray ( Collection < File > files ) { } private static void innerListFiles ( Collection < File > files , File directory , IOFileFilter filter ) { } public static Collection < File > listFiles ( File directory , IOFileFilter fileFilter , IOFileFilter dirFilter ) { } public static Iterator < File > iterateFiles ( File directory , IOFileFilter fileFilter , IOFileFilter dirFilter ) { } private static String [ ] toSuffixes ( String [ ] extensions ) { } public static Collection < File > listFiles ( File directory , String [ ] extensions , boolean recursive ) { } public static Iterator < File > iterateFiles ( File directory , String [ ] extensions , boolean recursive ) { } public static boolean contentEquals ( File file1 , File file2 ) throws IOException { } public static File toFile ( URL url ) { } static String decodeUrl ( String url ) { } public static File [ ] toFiles ( URL [ ] urls ) { } public static URL [ ] toURLs ( File [ ] files ) throws IOException { } public static void copyFileToDirectory ( File srcFile , File destDir ) throws IOException { } public static void copyFileToDirectory ( File srcFile , File destDir , boolean preserveFileDate ) throws IOException { } public static void copyFile ( File srcFile , File destFile ) throws IOException { } public static void copyFile ( File srcFile , File destFile , boolean preserveFileDate ) throws IOException { } private static void doCopyFile ( File srcFile , File destFile , boolean preserveFileDate ) throws IOException { } public static void copyDirectoryToDirectory ( File srcDir , File destDir ) throws IOException { } public static void copyDirectory ( File srcDir , File destDir ) throws IOException { } public static void copyDirectory ( File srcDir , File destDir , boolean preserveFileDate ) throws IOException { } public static void copyDirectory ( File srcDir , File destDir , FileFilter filter ) throws IOException { } public static void copyDirectory ( File srcDir , File destDir , FileFilter filter , boolean preserveFileDate ) throws IOException { } private static void doCopyDirectory ( File srcDir , File destDir , FileFilter filter , boolean preserveFileDate , List < String > exclusionList ) throws IOException { } public static void copyURLToFile ( URL source , File destination ) throws IOException { } public static void copyURLToFile ( URL source , File destination , int connectionTimeout , int readTimeout ) throws IOException { } public static void copyInputStreamToFile ( InputStream source , File destination ) throws IOException { } public static void deleteDirectory ( File directory ) throws IOException { } public static boolean deleteQuietly ( File file ) { } public static void cleanDirectory ( File directory ) throws IOException { } public static boolean waitFor ( File file , int seconds ) { } public static String readFileToString ( File file , String encoding ) throws IOException { } public static String readFileToString ( File file ) throws IOException { } public static byte [ ] readFileToByteArray ( File file ) throws IOException { InputStream in = null ; try { in = FileUtils . openInputStream ( file ) ; <START_BUG> return IOUtils . toByteArray ( in ) ; <END_BUG> } finally { IOUtils . closeQuietly ( in ) ; } } public static List < String > readLines ( File file , String encoding ) throws IOException { } public static List < String > readLines ( File file ) throws IOException { } public static LineIterator lineIterator ( File file , String encoding ) throws IOException { } public static LineIterator lineIterator ( File file ) throws IOException { } public static void writeStringToFile ( File file , String data , String encoding ) throws IOException { } public static void writeStringToFile ( File file , String data , String encoding , boolean append ) throws IOException { } public static void writeStringToFile ( File file , String data ) throws IOException { } public static void writeStringToFile ( File file , String data , boolean append ) throws IOException { } public static void write ( File file , CharSequence data ) throws IOException { } public static void write ( File file , CharSequence data , boolean append ) throws IOException { } public static void write ( File file , CharSequence data , String encoding ) throws IOException { } public static void write ( File file , CharSequence data , String encoding , boolean append ) throws IOException { } public static void writeByteArrayToFile ( File file , byte [ ] data ) throws IOException { } public static void writeByteArrayToFile ( File file , byte [ ] data , boolean append ) throws IOException { } public static void writeLines ( File file , String encoding , Collection < ? > lines ) throws IOException { } public static void writeLines ( File file , String encoding , Collection < ? > lines , boolean append ) throws IOException { } public static void writeLines ( File file , Collection < ? > lines ) throws IOException { } public static void writeLines ( File file , Collection < ? > lines , boolean append ) throws IOException { }

Fix:
return IOUtils . toByteArray ( in , file . length ( ) ) ;