public class MultipartRequestInputStream
extends java.io.BufferedInputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
boundary |
protected FileUploadHeader |
lastHeader |
| Constructor and Description |
|---|
MultipartRequestInputStream(java.io.InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
int |
copyAll(java.io.OutputStream out)
Copies bytes from this stream to some output until boundary is
reached.
|
int |
copyMax(java.io.OutputStream out,
int maxBytes)
Copies max or less number of bytes to output stream.
|
FileUploadHeader |
getLastHeader() |
boolean |
isBoundary(byte b)
Checks if the current byte (i.e. one that was read last) represents
the very first byte of the boundary.
|
byte[] |
readBoundary()
Reads boundary from the input stream.
|
byte |
readByte()
Reads expected byte.
|
FileUploadHeader |
readDataHeader(java.lang.String encoding)
Reads data header from the input stream.
|
protected java.lang.String |
readDataHeaderString(java.lang.String encoding) |
void |
skipBytes(int i)
Skips specified number of bytes.
|
int |
skipToBoundary()
Skips to the boundary and returns total number of bytes skipped.
|
protected byte[] boundary
protected FileUploadHeader lastHeader
public MultipartRequestInputStream(java.io.InputStream in)
public byte readByte()
throws java.io.IOException
java.io.IOExceptionpublic void skipBytes(int i)
throws java.io.IOException
java.io.IOExceptionpublic byte[] readBoundary()
throws java.io.IOException
java.io.IOExceptionpublic FileUploadHeader getLastHeader()
public FileUploadHeader readDataHeader(java.lang.String encoding) throws java.io.IOException
nulljava.io.IOExceptionprotected java.lang.String readDataHeaderString(java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic int copyAll(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic int copyMax(java.io.OutputStream out,
int maxBytes)
throws java.io.IOException
java.io.IOExceptionpublic int skipToBoundary()
throws java.io.IOException
java.io.IOExceptionpublic boolean isBoundary(byte b)
throws java.io.IOException
java.io.IOExceptionCopyright © 2003-present Jodd Team