code: public static byte[] resourceFileToByteArray(final String location, final String fileName) {
          if (location == null || fileName == null) return null;
  
          final InputStream in = ResourceUtilities.class.getResourceAsStream(location + fileName);
          if (in == null) return null;
  
          final ByteArrayOutputStream out = new ByteArrayOutputStream();
  
          try {
              // Create the byte array to hold the data
              final byte[] buffer = new byte[1024];
  
              // Read in the bytes
              int numRead = 0;
              while((numRead = in.read(buffer)) > 0) {
                  out.write(buffer, 0, numRead);
              }
          } catch (final Exception ex) {
              LOG.error("An error occurred while reading the file contents", ex);
          } finally {
              try {
                  in.close();
              } catch (final Exception ex) {
                  LOG.error("Failed to close the InputStream", ex);
              }
          }
          return out.toByteArray();
      }
docs: Reads a resource file and converts it into a String
  
  @param location The location of the resource file.
  @param fileName The name of the file.
  @return The string that represents the contents of the file or null if an error occurred.