public class MultipartRequestInputStream extends BufferedInputStream
Modifier and Type | Field and Description |
---|---|
protected byte[] |
boundary
part部分边界
|
protected UploadFileHeader |
lastHeader |
in
Constructor and Description |
---|
MultipartRequestInputStream(InputStream in) |
Modifier and Type | Method and Description |
---|---|
int |
copy(OutputStream out)
全部字节流复制到out
|
int |
copy(OutputStream out,
int limit)
复制字节流到out, 大于maxBytes或者文件末尾停止
|
UploadFileHeader |
getLastHeader() |
boolean |
isBoundary(byte b) |
byte[] |
readBoundary()
输入流中读取边界
|
byte |
readByte()
读取byte字节流,在末尾抛出异常
|
UploadFileHeader |
readDataHeader(String encoding)
从流中读取文件头部信息, 如果达到末尾则返回null
|
protected String |
readDataHeaderString(String encoding) |
void |
skipBytes(int i)
跳过指定位数的 bytes.
|
int |
skipToBoundary()
跳过边界表示
|
available, close, mark, markSupported, read, read, reset, skip
read
protected byte[] boundary
protected UploadFileHeader lastHeader
public MultipartRequestInputStream(InputStream in)
public byte readByte() throws IOException
IOException
- 读取异常public void skipBytes(int i) throws IOException
i
- 跳过的byte数IOException
- IO异常public byte[] readBoundary() throws IOException
IOException
- 读取异常public UploadFileHeader getLastHeader()
public UploadFileHeader readDataHeader(String encoding) throws IOException
encoding
- 字符集IOException
- 读取异常protected String readDataHeaderString(String encoding) throws IOException
IOException
public int copy(OutputStream out) throws IOException
out
- 输出流IOException
- 读取异常public int copy(OutputStream out, int limit) throws IOException
out
- 输出流limit
- 最大字节数IOException
- 读取异常public int skipToBoundary() throws IOException
IOException
- 读取异常public boolean isBoundary(byte b) throws IOException
b
- byteIOException
- 读取异常Copyright © 2020. All rights reserved.