Class FragmentedImpExInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.hybris.datahub.core.services.impl.FragmentedImpExInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class FragmentedImpExInputStream extends java.io.InputStreamAn input stream for reading the fragmented ImpEx file content received from DataHub.
-
-
Constructor Summary
Constructors Constructor Description FragmentedImpExInputStream(java.util.List<ImpExFragment> f)Instantiates this input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()booleanmarkSupported()intread()intread(byte[] b, int off, int len)Override in order to catch custom exception and rethrow IOException.
-
-
-
Constructor Detail
-
FragmentedImpExInputStream
public FragmentedImpExInputStream(java.util.List<ImpExFragment> f)
Instantiates this input stream.- Parameters:
f- a list of ImpEx fragments to read content from. This stream will read the fragments in the same order they received in the list.
-
-
Method Detail
-
read
public int read()
- Specified by:
readin classjava.io.InputStream
-
read
public int read(byte[] b, int off, int len) throws java.io.IOExceptionOverride in order to catch custom exception and rethrow IOException. This is necessary because the default implementation swallows IOException silently which causes MediaUtil.copy() to continue to read as it expects more data to arrive.- Overrides:
readin classjava.io.InputStream- Parameters:
b-off-len-- Returns:
- The amount of bytes that were read.
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
-