src/Tools.java
public static byte[] ReadFile(File i_File)
	{
		FileInputStream fis = null;
		try
		{
			byte[] fileInBytesArray = new byte[(int)i_File.length()];
			fis = new FileInputStream(i_File);
			while(fis.available() != 0)
			{
				fis.read(fileInBytesArray, 0, fileInBytesArray.length);
			}
			return fileInBytesArray;
		}
		catch(FileNotFoundException i_FNFE)
		{
			System.out.println("File not found");
			return null;
		}
		catch(IOException i_IOE)
		{
			System.out.println("IOException");
			return null;
		} 
		finally {
			if (fis != null) {
				try {
					fis.close();
				} catch (IOException e) {
					System.out.println("No socket to write the respone to.");
				}
			}
		}
	}
/*
	 * Read from file.
	 * Return the file in byte array.
	 */
Read from file.
Return the file in byte array.
Read from file . Return the file in byte array .
public static byte[] ReadFile(File i_File)
	{
		FileInputStream fis = null;
		try
		{
			byte[] fileInBytesArray = new byte[(int)i_File.length()];
			fis = new FileInputStream(i_File);
			while(fis.available() != 0)
			{
				fis.read(fileInBytesArray, 0, fileInBytesArray.length);
			}
			return fileInBytesArray;
		}
		catch(FileNotFoundException i_FNFE)
		{
			System.out.println("File not found");
			return null;
		}
		catch(IOException i_IOE)
		{
			System.out.println("IOException");
			return null;
		} 
		finally {
			if (fis != null) {
				try {
					fis.close();
				} catch (IOException e) {
					System.out.println("No socket to write the respone to.");
				}
			}
		}
	}
public static byte [ ] ReadFile ( File i_File ) { FileInputStream fis = null ; try { byte [ ] fileInBytesArray = new byte [ ( int ) i_File . length ( ) ] ; fis = new FileInputStream ( i_File ) ; while ( fis . available ( ) != 0 ) { fis . read ( fileInBytesArray , 0 , fileInBytesArray . length ) ; } return fileInBytesArray ; } catch ( FileNotFoundException i_FNFE ) { System . out . println ( "File not found" ) ; return null ; } catch ( IOException i_IOE ) { System . out . println ( "IOException" ) ; return null ; } finally { if ( fis != null ) { try { fis . close ( ) ; } catch ( IOException e ) { System . out . println ( "No socket to write the respone to." ) ; } } } }
Read from file.
Read from file .