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.transport.http.functional;
8   
9   import org.mule.api.MuleEventContext;
10  import org.mule.api.lifecycle.Callable;
11  import org.mule.transformer.types.DataTypeFactory;
12  
13  import java.io.InputStream;
14  
15  public class PartialReadComponent implements Callable
16  {
17      public Object onCall(MuleEventContext eventContext) throws Exception
18      {
19          InputStream stream = (InputStream) eventContext.getMessage().getPayload(DataTypeFactory.create(InputStream.class));
20  
21          stream.read();
22          return "Hello";
23      }
24  }