code: private byte[] getContent(InputStream in) throws FMSException {
  		ByteArrayOutputStream baos = new ByteArrayOutputStream();
  		byte[] content = null;
  		try {
  			int nRead;
  			byte[] data = new byte[1028];
  			while ((nRead = in.read(data, 0, data.length)) != -1) {
  			  baos.write(data, 0, nRead);
  			}
  			baos.flush();
  			content = baos.toByteArray();
  		} catch (IOException e) {
  			throw new FMSException("Error while reading the upload file.", e);
  		} finally {
  			close(baos);
  			close(in);
  		}
  		return content;
  	}
docs: Method to return the byte[] value of the given file input stream
  
  @param in the input stream
  @return byte[] the file content
  @throws FMSException