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 TypeMethodDescriptionvoid
close()
By "close", we will read from theInputStream
until we have finished the body, so that our InputStream has been read until the start of the next partition.int
read()
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:
read
in 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:
readAllBytes
in classInputStream
-
close
By "close", we will read from theInputStream
until we have finished the body, so that our InputStream has been read until the start of the next partition.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-