// Path: core/src/main/java/net/javacrumbs/mocksocket/connection/data/OutputSocketData.java
// public class OutputSocketData implements RequestSocketData {
// 	
// 	private final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
// 	
// 	private final String address;
// 	
// 	public OutputSocketData(String address) {
// 		this.address = address;
// 	}
// 
// 	public InputStream getData() {
// 		return new ByteArrayInputStream(getDataAsBytes());
// 	}
// 	
// 	protected byte[] getDataAsBytes()
// 	{
// 		return outputStream.toByteArray();
// 	}
// 	
// 	public OutputStream getOutputStream() {
// 		return outputStream;
// 	}
// 
// 	public String getAddress() {
// 		return address;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return StringUtils.convertDataToString(getDataAsBytes());
// 	}
// 
// }
// 
// Path: core/src/main/java/net/javacrumbs/mocksocket/connection/data/SocketData.java
// public interface SocketData {
// 
// 	public InputStream getData();
// }
// 
// Path: core/src/main/java/net/javacrumbs/mocksocket/util/Utils.java
// public class Utils {
// 	private Utils()
// 	{
// 		//empty
// 	}
// 	
// 	public static final byte[] toByteArray(InputStream stream)
// 	{
// 		try 
// 		{
// 			return IOUtils.toByteArray(stream);
// 		} 
// 		catch (IOException e)
// 		{
// 			throw new MockSocketException("Can not read data.",e);
// 		}
// 		finally
// 		{
// 			IOUtils.closeQuietly(stream);
// 		}
// 	}
// }


import org.eclipse.jetty.testing.HttpTester;
import org.eclipse.jetty.util.ByteArrayOutputStream2;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.List;
import net.javacrumbs.mocksocket.connection.data.OutputSocketData;
import net.javacrumbs.mocksocket.connection.data.SocketData;
import net.javacrumbs.mocksocket.util.Utils;
import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.ByteArrayBuffer;
import org.eclipse.jetty.io.View;
	@SuppressWarnings("unchecked")
	public List<String> getHeaderNames() {
		return Collections.list(httpTester.getHeaderNames());
	}

	public long getLongHeader(String name) throws NumberFormatException {
		return httpTester.getLongHeader(name);
	}

	public String getHeader(String name) {
		return httpTester.getHeader(name);
	}

	@SuppressWarnings("unchecked")
	public List<String> getHeaderValues(String name) {
		return  Collections.list(httpTester.getHeaderValues(name));
	}

	public String getContent() {
		return httpTester.getContent();
	}
	
	public InputStream getData() {
		return socketData.getData();
	}
	
	/**
	 * Returns address to which the request was sent to or null.
	 */
	public String getAddress() {
// Path: core/src/main/java/net/javacrumbs/mocksocket/connection/data/OutputSocketData.java
// public class OutputSocketData implements RequestSocketData {
// 	
// 	private final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
// 	
// 	private final String address;
// 	
// 	public OutputSocketData(String address) {
// 		this.address = address;
// 	}
// 
// 	public InputStream getData() {
// 		return new ByteArrayInputStream(getDataAsBytes());
// 	}
// 	
// 	protected byte[] getDataAsBytes()
// 	{
// 		return outputStream.toByteArray();
// 	}
// 	
// 	public OutputStream getOutputStream() {
// 		return outputStream;
// 	}
// 
// 	public String getAddress() {
// 		return address;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return StringUtils.convertDataToString(getDataAsBytes());
// 	}
// 
// }
// 
// Path: core/src/main/java/net/javacrumbs/mocksocket/connection/data/SocketData.java
// public interface SocketData {
// 
// 	public InputStream getData();
// }
// 
// Path: core/src/main/java/net/javacrumbs/mocksocket/util/Utils.java
// public class Utils {
// 	private Utils()
// 	{
// 		//empty
// 	}
// 	
// 	public static final byte[] toByteArray(InputStream stream)
// 	{
// 		try 
// 		{
// 			return IOUtils.toByteArray(stream);
// 		} 
// 		catch (IOException e)
// 		{
// 			throw new MockSocketException("Can not read data.",e);
// 		}
// 		finally
// 		{
// 			IOUtils.closeQuietly(stream);
// 		}
// 	}
// }


// Path: http/src/main/java/net/javacrumbs/mocksocket/http/HttpParser.java
import org.eclipse.jetty.testing.HttpTester;
import org.eclipse.jetty.util.ByteArrayOutputStream2;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.List;
import net.javacrumbs.mocksocket.connection.data.OutputSocketData;
import net.javacrumbs.mocksocket.connection.data.SocketData;
import net.javacrumbs.mocksocket.util.Utils;
import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.ByteArrayBuffer;
import org.eclipse.jetty.io.View;

	@SuppressWarnings("unchecked")
	public List<String> getHeaderNames() {
		return Collections.list(httpTester.getHeaderNames());
	}

	public long getLongHeader(String name) throws NumberFormatException {
		return httpTester.getLongHeader(name);
	}

	public String getHeader(String name) {
		return httpTester.getHeader(name);
	}

	@SuppressWarnings("unchecked")
	public List<String> getHeaderValues(String name) {
		return  Collections.list(httpTester.getHeaderValues(name));
	}

	public String getContent() {
		return httpTester.getContent();
	}
	
	public InputStream getData() {
		return socketData.getData();
	}
	
	/**
	 * Returns address to which the request was sent to or null.
	 */
	public String getAddress() {
		if (socketData instanceof OutputSocketData)