Class MultipleActionsInputStream
java.lang.Object
java.io.InputStream
io.clonecloudstore.common.standard.inputstream.MultipleActionsInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionMultipleActionsInputStream(InputStream inputStream) MultipleActionsInputStream(InputStream inputStream, DigestAlgo digestAlgo) -
Method Summary
Modifier and TypeMethodDescriptionvoidasyncPipedInputStream(AtomicReference<Exception> callerExceptionAtomicReference) intvoidclose()voidcompress()voidcompress(int level) static MultipleActionsInputStreamcreate(InputStream inputStream) static MultipleActionsInputStreamcreate(InputStream inputStream, boolean digestNeeded) voidDefault Digest base 32byte[]longvoidinvalidExceptionDuringConsumeWhileErrorInputStream(boolean valid) Allows to prevent exception during ConsumeWhileError by enclosing call between False and True setbooleanbooleanintread()intread(byte[] b) intread(byte[] b, int off, int len) longskip(long n) toString()longtransferTo(OutputStream out) longwaitForAllRead(long timeWaitMs) Methods inherited from class java.io.InputStream
mark, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes
-
Constructor Details
-
MultipleActionsInputStream
-
MultipleActionsInputStream
public MultipleActionsInputStream(InputStream inputStream, DigestAlgo digestAlgo) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-
-
Method Details
-
create
-
create
public static MultipleActionsInputStream create(InputStream inputStream, boolean digestNeeded) throws NoSuchAlgorithmException - Throws:
NoSuchAlgorithmException
-
asyncPipedInputStream
-
compress
- Throws:
IOException
-
compress
- Throws:
IOException
-
decompress
- Throws:
IOException
-
getSourceRead
public long getSourceRead() -
waitForAllRead
public long waitForAllRead(long timeWaitMs) - Returns:
- the size if the read is over, or returns -1 if read not finished in the given time
-
invalidExceptionDuringConsumeWhileErrorInputStream
public void invalidExceptionDuringConsumeWhileErrorInputStream(boolean valid) Allows to prevent exception during ConsumeWhileError by enclosing call between False and True set -
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
transferTo
- Overrides:
transferToin classInputStream- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
getDigestValue
public byte[] getDigestValue()- Returns:
- the digest value (to be called once the InputStream is over)
-
getDigestBase64
- Returns:
- the digest value (to be called once the InputStream is over)
-
getDigestBase32
- Returns:
- the digest value (to be called once the InputStream is over)
-
getDigest
Default Digest base 32 -
isDigestEnabled
public boolean isDigestEnabled() -
toString
-