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 |
---|---|
long |
copy(OutputStream out)
字节流复制到out,直到下一个boundary
|
long |
copy(OutputStream out,
long limit)
复制字节流到out, 大于maxBytes或者文件末尾停止
|
UploadFileHeader |
getLastHeader() |
boolean |
isBoundary(byte b) |
byte[] |
readBoundary()
输入流中读取边界
|
byte |
readByte()
读取byte字节流,在末尾抛出异常
|
UploadFileHeader |
readDataHeader(Charset encoding)
从流中读取文件头部信息, 如果达到末尾则返回null
|
protected String |
readDataHeaderString(Charset charset)
读取数据头信息字符串
|
String |
readString(Charset charset)
读取字节流,直到下一个boundary
|
void |
skipBytes(long i)
跳过指定位数的 bytes.
|
long |
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(long i) throws IOException
i
- 跳过的byte数IOException
- IO异常public byte[] readBoundary() throws IOException
IOException
- 读取异常public UploadFileHeader getLastHeader()
public UploadFileHeader readDataHeader(Charset encoding) throws IOException
encoding
- 字符集IOException
- 读取异常protected String readDataHeaderString(Charset charset) throws IOException
charset
- 编码IOException
- IO异常public String readString(Charset charset) throws IOException
charset
- 编码,null表示系统默认编码IOException
- 读取异常public long copy(OutputStream out) throws IOException
out
- 输出流IOException
- 读取异常public long copy(OutputStream out, long limit) throws IOException
out
- 输出流limit
- 最大字节数IOException
- 读取异常public long skipToBoundary() throws IOException
IOException
- 读取异常public boolean isBoundary(byte b) throws IOException
b
- byteIOException
- 读取异常Copyright © 2024. All rights reserved.