Class EncryptedWriter

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

    public class EncryptedWriter
    extends java.io.BufferedWriter
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SIGNATURE  
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      EncryptedWriter​(java.io.OutputStream stream)  
      EncryptedWriter​(java.io.Writer stream)  
      EncryptedWriter​(java.io.Writer writer, java.io.OutputStream stream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.lang.String getAlgorithm()  
      java.io.OutputStream getOutputStream()  
      void newLine()  
      void setAlgorithm​(java.lang.String cipherAlgorithm)  
      void setKey​(SecurityCrypto key)  
      void useKey​(java.lang.String keyPath)  
      void write​(java.lang.String str)  
      • Methods inherited from class java.io.BufferedWriter

        flush, write, write, write
      • Methods inherited from class java.io.Writer

        append, append, append, nullWriter, write
      • Methods inherited from class java.lang.Object

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

      • EncryptedWriter

        public EncryptedWriter​(java.io.OutputStream stream)
      • EncryptedWriter

        public EncryptedWriter​(java.io.Writer stream)
      • EncryptedWriter

        public EncryptedWriter​(java.io.Writer writer,
                               java.io.OutputStream stream)
    • Method Detail

      • useKey

        public void useKey​(java.lang.String keyPath)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setAlgorithm

        public void setAlgorithm​(java.lang.String cipherAlgorithm)
      • getAlgorithm

        public java.lang.String getAlgorithm()
      • write

        public void write​(java.lang.String str)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • newLine

        public void newLine()
                     throws java.io.IOException
        Overrides:
        newLine in class java.io.BufferedWriter
        Throws:
        java.io.IOException
      • getOutputStream

        public java.io.OutputStream getOutputStream()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.BufferedWriter
        Throws:
        java.io.IOException