public static byte[] getFileBytes(File file) {
		try {
			InputStream is = new FileInputStream(file);
			long length = file.length();
			if (length > Integer.MAX_VALUE) {
				System.out.println("File " + file.getName() + " was too big to attain file bytes.");
				is.close();
				return null;
			}
			byte[] bytes = new byte[(int)length];
			for(int i = 0; i < length; i++) {
				bytes[i] = 0x0;
			}
			
			int offset = 0;
			int numRead = 0;
			while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length - offset)) >= 0) {
				offset += numRead;
			}
			
			if (offset < bytes.length) {
				is.close();
				throw new IOException("Could not completely read file "+file.getName());
			}
			
	        is.close();
	        return bytes;
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}