View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.test.integration.streaming;
8   
9   import java.io.ByteArrayOutputStream;
10  import java.io.IOException;
11  import java.io.InputStream;
12  
13  import org.apache.commons.io.IOUtils;
14  
15  /**
16   * A simple bridge service for testing entry point resolution
17   */
18  public class SimpleStreamingBean
19  {
20      public byte[] doit(InputStream in) throws IOException
21      {
22          ByteArrayOutputStream out = new ByteArrayOutputStream();
23          IOUtils.copy(in, out);
24          in.close();
25          return out.toByteArray();
26      }
27  }