Class GSSOutputStream

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

    public class GSSOutputStream
    extends PgBufferedOutputStream
    Output stream that wraps each packed with GSS encryption.
    • Constructor Summary

      Constructors 
      Constructor Description
      GSSOutputStream​(PgBufferedOutputStream out, org.ietf.jgss.GSSContext gssContext, org.ietf.jgss.MessageProp messageProp, int maxTokenSize)
      Creates GSS output stream.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void flushBuffer()  
      private static int getBufferSize​(org.ietf.jgss.GSSContext gssContext, org.ietf.jgss.MessageProp messageProp, int maxTokenSize)  
      void write​(byte[] b, int off, int len)  
      private void writeWrapped​(byte[] b, int off, int len)  
      • Methods inherited from class java.io.FilterOutputStream

        close, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

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

      • gssContext

        private final org.ietf.jgss.GSSContext gssContext
      • messageProp

        private final org.ietf.jgss.MessageProp messageProp
    • Constructor Detail

      • GSSOutputStream

        public GSSOutputStream​(PgBufferedOutputStream out,
                               org.ietf.jgss.GSSContext gssContext,
                               org.ietf.jgss.MessageProp messageProp,
                               int maxTokenSize)
                        throws org.ietf.jgss.GSSException
        Creates GSS output stream.
        Parameters:
        out - output stream for the encrypted data
        gssContext - gss context
        messageProp - message properties
        maxTokenSize - maximum length of the encrypted messages
        Throws:
        org.ietf.jgss.GSSException
    • Method Detail

      • getBufferSize

        private static int getBufferSize​(org.ietf.jgss.GSSContext gssContext,
                                         org.ietf.jgss.MessageProp messageProp,
                                         int maxTokenSize)
                                  throws org.ietf.jgss.GSSException
        Throws:
        org.ietf.jgss.GSSException
      • writeWrapped

        private void writeWrapped​(byte[] b,
                                  int off,
                                  int len)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class PgBufferedOutputStream
        Throws:
        java.io.IOException