All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yelong.support.servlet.wrapper.BufferedServletInputStream Maven / Gradle / Ivy

Go to download

对各种开源框架的包装、支持、拓展。这里也包含的yelong-core与orm框架的整合。 默认对所有依赖为 scope 为 provided 。您需要针对自己的需要进行再次依赖

There is a newer version: 2.2.0
Show newest version
/**
 * 
 */
package org.yelong.support.servlet.wrapper;

import java.io.ByteArrayInputStream;
import java.io.IOException;

import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;

/**
 * @author PengFei
 */
public class BufferedServletInputStream extends ServletInputStream{

	private ByteArrayInputStream inputStream;
	
	public BufferedServletInputStream(byte [] buffer) {
		this.inputStream = new ByteArrayInputStream(buffer);
	}
	
	@Override
	public int available() throws IOException {
		return inputStream.available();
	}
	
	@Override
	public boolean isFinished() {
		return inputStream.available() == 0;
	}

	@Override
	public boolean isReady() {
		return true;
	}

	@Override
	public void setReadListener(ReadListener readListener) {
		
	}

	@Override
	public int read() throws IOException {
		return inputStream.read();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy