package org.kne.cloud.network;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

public class ProtocolDetectorSocket extends FilterSocket {
	public ProtocolDetectorSocket(Socket socket) {
		super(socket);
	}

	private ProtocolStack protocolStack=new ProtocolStack();

	
	public ProtocolStack getProtocolStack() {
		return protocolStack;
	}

	private InputStream sin;
	@Override
	public InputStream getInputStream() throws IOException {
		InputStream spin=super.getInputStream();
		if(spin.markSupported())
		return spin;
		if(sin==null)
		sin=new BufferedInputStream(spin, 2048);
		return sin;
	}

	
	
}
