code: public static byte[] getBytes(File file) throws IOException {
  		InputStream in = new FileInputStream(file);
  		int fileSize = (int) file.length();
  
  		if (fileSize > Integer.MAX_VALUE) {
  			in.close();
  			throw new IOException("File size to large: " + fileSize + " > " + Integer.MAX_VALUE);
  		}
  
  		byte[] bytes = new byte[fileSize];
  
  		// Read in the bytes
  		int offset = 0;
  		int numRead = 0;
  		while (offset < bytes.length && (numRead = in.read(bytes, offset, bytes.length-offset)) >= 0) {
  			offset += numRead;
  		}
  
  		// Ensure all the bytes have been read in
  		if (offset < bytes.length) {
  			in.close();
  			throw new IOException("Could not completely read file " + file.getName());
  		}
  
  		in.close();
  
  		return bytes;
  	}
docs: Returns the <code>byte</code>[] rawValue of the given <code>File</code>.