You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
57 lines
1.2 KiB
4 years ago
|
/*
|
||
|
* Copyright (C), 2018-2021
|
||
|
* Project: starter
|
||
|
* FileName: DelegatingServletInputStream
|
||
|
* Author: Louis
|
||
|
* Date: 2021/7/16 9:21
|
||
|
*/
|
||
|
package com.fr.plugin.dingtalksyn.request;
|
||
|
|
||
|
import javax.servlet.ReadListener;
|
||
|
import javax.servlet.ServletInputStream;
|
||
|
import java.io.IOException;
|
||
|
import java.io.InputStream;
|
||
|
|
||
|
/**
|
||
|
* <Function Description><br>
|
||
|
* <DelegatingServletInputStream>
|
||
|
*
|
||
|
* @author fr.open
|
||
|
* @since 1.0.0
|
||
|
*/
|
||
|
public class DelegatingServletInputStream extends ServletInputStream {
|
||
|
private final InputStream sourceStream;
|
||
|
|
||
|
public DelegatingServletInputStream(InputStream stream) {
|
||
|
this.sourceStream = stream;
|
||
|
}
|
||
|
|
||
|
public final InputStream getSourceStream() {
|
||
|
return this.sourceStream;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public int read() throws IOException {
|
||
|
return this.sourceStream.read();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void close() throws IOException {
|
||
|
super.close();
|
||
|
this.sourceStream.close();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean isFinished() {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean isReady() {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void setReadListener(ReadListener listener) {
|
||
|
}
|
||
|
}
|