NdsBeisEsb/src/test/java/com/northgateps/nds/beis/esb/viewdocument/viewDocumentRouteTest.java
/**
    * Following method convert file into bytes which need to pass into back-office response
    * @param fileName
    * @return
    * @throws Exception
    */
Following method convert file into bytes which need to pass into back-office response
@param fileName
@return
@throws Exception
Following method convert file into bytes which need to pass into back - office response @param fileName @return @throws Exception
public static byte[] loadFileAsBytesArray(String fileName) throws Exception {        
        java.io.File file = new java.io.File(fileName);
        int length = (int) file.length();
        java.io.BufferedInputStream reader = new java.io.BufferedInputStream(new java.io.FileInputStream(file));
        byte[] bytes = new byte[length];
        reader.read(bytes, 0, length);
        reader.close();
        return bytes;
    }
public static byte [ ] loadFileAsBytesArray ( String fileName ) throws Exception { java . io . File file = new java . io . File ( fileName ) ; int length = ( int ) file . length ( ) ; java . io . BufferedInputStream reader = new java . io . BufferedInputStream ( new java . io . FileInputStream ( file ) ) ; byte [ ] bytes = new byte [ length ] ; reader . read ( bytes , 0 , length ) ; reader . close ( ) ; return bytes ; }
Following method convert file into bytes which need to pass into back-office response
 @param fileName
 @return
 @throws Exception
Following method convert file into bytes which need to pass into back - office response @param fileName @return @throws Exception