Class EncryptionInputStream

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable

    
    public class EncryptionInputStream
    extends FilterInputStream
                        

    This class provides a wrapper for an InputStream that encrypts or decrypts the bytes as they are read.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      EncryptionInputStream(InputStream in, boolean encrypt, Array<byte> encryptionKey)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int read()
      int read(@NonNull() Array<byte> b)
      int read(@NonNull() Array<byte> b, int off, int len)
      long skip(long n) Unsupported.
      int available()
      void close()
      synchronized void mark(int readlimit) Unsupported.
      synchronized void reset() Unsupported.
      boolean markSupported()
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EncryptionInputStream

        EncryptionInputStream(InputStream in, boolean encrypt, Array<byte> encryptionKey)
        Parameters:
        in - The InputStream that will be encrypted/decrypted.
        encrypt - True means the InputStream will be encrypted.
        encryptionKey - The key which is used for encryption/decryption.
    • Method Detail

      • read

         int read(@NonNull() Array<byte> b)
      • read

         int read(@NonNull() Array<byte> b, int off, int len)
      • skip

         long skip(long n)

        Unsupported. This method will throw an UnsupportedOperationException.

        Parameters:
        n - ignored
      • mark

         synchronized void mark(int readlimit)

        Unsupported. This method will throw an UnsupportedOperationException.

        Parameters:
        readlimit - ignored
      • reset

         synchronized void reset()

        Unsupported. This method will throw an UnsupportedOperationException.