// Path: src/main/java/org/kopi/ebics/exception/EbicsException.java
// public class EbicsException extends Exception {
// 
//   /**
//    * A means to construct a server error.
//    */
//   public EbicsException() {}
// 
//   /**
//    * A means to construct a server error with an additional message.
//    * @param message the exception message
//    */
//   public EbicsException(String message) {
//     super(message);
//   }
//   /**
//    * A means to construct a server error with no additional message.
//    * @param returnCode the ebics return code.
//    */
//   public EbicsException(ReturnCode returnCode) {
//     this.returnCode = returnCode;
//   }
// 
//   /**
//    * A means to construct a server error with an additional message.
//    * @param returnCode the ebics return code.
//    * @param message the additional message.
//    */
//   public EbicsException(ReturnCode returnCode, String message) {
//     super(message);
//     this.returnCode = returnCode;
//   }
// 
//   /**
//    * Returns the standardized error code.
//    * @return the standardized error code.
//    */
//   public ReturnCode getReturnCode() {
//     return returnCode;
//   }
// 
//   // --------------------------------------------------------------------
//   // DATA MEMBERS
//   // --------------------------------------------------------------------
// 
//   private ReturnCode 		returnCode;
//   private static final long 	serialVersionUID = 2728820344946361669L;
// }
// 
// Path: src/main/java/org/kopi/ebics/interfaces/ContentFactory.java
// public interface ContentFactory extends Serializable {
// 
//   /**
//    * Returns a new data source of the data to be sent.
//    * The instance must ensure that the returned stream will
//    * deliver the identical data during the lifetime of this instance.
//    * Nevertheless how often the method will be called.
//    * @return a new data source of the data to be sent.
//    * @throws IOException
//    */
//   public InputStream getContent() throws IOException;
// }


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.kopi.ebics.exception.EbicsException;
import org.kopi.ebics.interfaces.ContentFactory;
    return file;
  }

  /**
   * Returns the content of a file as byte array.
   * @param path the file path
   * @return the byte array content of the file
   * @throws EbicsException
   */
  public static byte[] getFileContent(String path) throws EbicsException {
    try {
      InputStream			input;
      byte[]				content;

      input = new FileInputStream(path);
      content = new byte[input.available()];
      input.read(content);
      input.close();
      return content;
    } catch (IOException e) {
      throw new EbicsException(e.getMessage());
    }
  }

  /**
   * Returns the content of a <code>ContentFactory</code> as a byte array
   * @param content
   * @return
   * @throws EbicsException
   */
// Path: src/main/java/org/kopi/ebics/exception/EbicsException.java
// public class EbicsException extends Exception {
// 
//   /**
//    * A means to construct a server error.
//    */
//   public EbicsException() {}
// 
//   /**
//    * A means to construct a server error with an additional message.
//    * @param message the exception message
//    */
//   public EbicsException(String message) {
//     super(message);
//   }
//   /**
//    * A means to construct a server error with no additional message.
//    * @param returnCode the ebics return code.
//    */
//   public EbicsException(ReturnCode returnCode) {
//     this.returnCode = returnCode;
//   }
// 
//   /**
//    * A means to construct a server error with an additional message.
//    * @param returnCode the ebics return code.
//    * @param message the additional message.
//    */
//   public EbicsException(ReturnCode returnCode, String message) {
//     super(message);
//     this.returnCode = returnCode;
//   }
// 
//   /**
//    * Returns the standardized error code.
//    * @return the standardized error code.
//    */
//   public ReturnCode getReturnCode() {
//     return returnCode;
//   }
// 
//   // --------------------------------------------------------------------
//   // DATA MEMBERS
//   // --------------------------------------------------------------------
// 
//   private ReturnCode 		returnCode;
//   private static final long 	serialVersionUID = 2728820344946361669L;
// }
// 
// Path: src/main/java/org/kopi/ebics/interfaces/ContentFactory.java
// public interface ContentFactory extends Serializable {
// 
//   /**
//    * Returns a new data source of the data to be sent.
//    * The instance must ensure that the returned stream will
//    * deliver the identical data during the lifetime of this instance.
//    * Nevertheless how often the method will be called.
//    * @return a new data source of the data to be sent.
//    * @throws IOException
//    */
//   public InputStream getContent() throws IOException;
// }


// Path: src/main/java/org/kopi/ebics/io/IOUtils.java
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.kopi.ebics.exception.EbicsException;
import org.kopi.ebics.interfaces.ContentFactory;

    return file;
  }

  /**
   * Returns the content of a file as byte array.
   * @param path the file path
   * @return the byte array content of the file
   * @throws EbicsException
   */
  public static byte[] getFileContent(String path) throws EbicsException {
    try {
      InputStream			input;
      byte[]				content;

      input = new FileInputStream(path);
      content = new byte[input.available()];
      input.read(content);
      input.close();
      return content;
    } catch (IOException e) {
      throw new EbicsException(e.getMessage());
    }
  }

  /**
   * Returns the content of a <code>ContentFactory</code> as a byte array
   * @param content
   * @return
   * @throws EbicsException
   */
  public static byte[] getFactoryContent(ContentFactory content) throws EbicsException {