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 TypeMethodDescriptionvoid
asyncPipedInputStream
(AtomicReference<Exception> callerExceptionAtomicReference) int
void
close()
void
compress()
void
compress
(int level) static MultipleActionsInputStream
create
(InputStream inputStream) static MultipleActionsInputStream
create
(InputStream inputStream, boolean digestNeeded) void
Default Digest base 32byte[]
long
void
invalidExceptionDuringConsumeWhileErrorInputStream
(boolean valid) Allows to prevent exception during ConsumeWhileError by enclosing call between False and True setboolean
boolean
int
read()
int
read
(byte[] b) int
read
(byte[] b, int off, int len) long
skip
(long n) toString()
long
transferTo
(OutputStream out) long
waitForAllRead
(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:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
transferTo
- Overrides:
transferTo
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in 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
-