Class CipherInputStream
- java.lang.Object
- 
- java.io.InputStream
- 
- java.io.FilterInputStream
- 
- software.amazon.awssdk.core.io.SdkFilterInputStream
- 
- software.amazon.encryption.s3.internal.CipherInputStream
 
 
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- software.amazon.awssdk.core.internal.io.Releasable
 - Direct Known Subclasses:
- AuthenticatedCipherInputStream
 
 public class CipherInputStream extends software.amazon.awssdk.core.io.SdkFilterInputStreamA cipher stream for encrypting or decrypting data using an unauthenticated block cipher.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Ciphercipherprotected intcurrentPositionprotected booleaneofReachedprotected byte[]inputBufferprotected intmaxPositionprotected byte[]outputBuffer- 
Fields inherited from class java.io.FilterInputStreamin
 
- 
 - 
Constructor SummaryConstructors Constructor Description CipherInputStream(InputStream inputStream, Cipher cipher)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()protected intendOfFileReached()voidmark(int readlimit)booleanmarkSupported()protected intnextChunk()Reads and process the next chunk of data into memory.intread()intread(byte[] buffer)intread(byte[] buffer, int off, int targetLength)voidreset()longskip(long n)
 
- 
- 
- 
Field Detail- 
cipherprotected final Cipher cipher 
 - 
eofReachedprotected boolean eofReached 
 - 
inputBufferprotected byte[] inputBuffer 
 - 
outputBufferprotected byte[] outputBuffer 
 - 
currentPositionprotected int currentPosition 
 - 
maxPositionprotected int maxPosition 
 
- 
 - 
Constructor Detail- 
CipherInputStreampublic CipherInputStream(InputStream inputStream, Cipher cipher) 
 
- 
 - 
Method Detail- 
readpublic int read() throws IOException- Overrides:
- readin class- software.amazon.awssdk.core.io.SdkFilterInputStream
- Throws:
- IOException
 
 - 
readpublic int read(byte[] buffer) throws IOException- Overrides:
- readin class- FilterInputStream
- Throws:
- IOException
 
 - 
readpublic int read(byte[] buffer, int off, int targetLength) throws IOException- Overrides:
- readin class- software.amazon.awssdk.core.io.SdkFilterInputStream
- Throws:
- IOException
 
 - 
skippublic long skip(long n) Note: This implementation will only skip up to the end of the buffered data, potentially skipping 0 bytes. - Overrides:
- skipin class- software.amazon.awssdk.core.io.SdkFilterInputStream
 
 - 
availablepublic int available() - Overrides:
- availablein class- software.amazon.awssdk.core.io.SdkFilterInputStream
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- software.amazon.awssdk.core.io.SdkFilterInputStream
- Throws:
- IOException
 
 - 
markSupportedpublic boolean markSupported() - Overrides:
- markSupportedin class- software.amazon.awssdk.core.io.SdkFilterInputStream
 
 - 
markpublic void mark(int readlimit) - Overrides:
- markin class- software.amazon.awssdk.core.io.SdkFilterInputStream
 
 - 
resetpublic void reset() throws IOException- Overrides:
- resetin class- software.amazon.awssdk.core.io.SdkFilterInputStream
- Throws:
- IOException
 
 - 
nextChunkprotected int nextChunk() throws IOExceptionReads and process the next chunk of data into memory.- Returns:
- the length of the data chunk read and processed, or -1 if end of stream.
- Throws:
- IOException- if there is an IO exception from the underlying input stream
 
 - 
endOfFileReachedprotected int endOfFileReached() 
 
- 
 
-