java.lang.Object
java.io.InputStream
com.renomad.minum.web.StreamingMultipartPartition
- All Implemented Interfaces:
Closeable,AutoCloseable
This class represents a single partition in a multipart/form
Request body, when read as an InputStream. This enables the
developer to pull data incrementally, rather than reading it
all into memory at once.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()By "close", we will read from theInputStreamuntil we have finished the body, so that our InputStream has been read until the start of the next partition.intread()Reads from the inputstream using a buffer for checking whether we've hit the end of a multpart partition.byte[]Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Method Details
-
getHeaders
-
getContentDisposition
-
read
Reads from the inputstream using a buffer for checking whether we've hit the end of a multpart partition.- Specified by:
readin classInputStream- Returns:
- -1 if we're at the end of a partition
- Throws:
IOException- if the inputstream is closed unexpectedly while reading.
-
readAllBytes
public byte[] readAllBytes()- Overrides:
readAllBytesin classInputStream
-
close
By "close", we will read from theInputStreamuntil we have finished the body, so that our InputStream has been read until the start of the next partition.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-