Class GSSInputStream

java.lang.Object
java.io.InputStream
org.postgresql.gss.GSSInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class GSSInputStream extends InputStream
  • Field Details

    • gssContext

      private final GSSContext gssContext
    • messageProp

      private final MessageProp messageProp
    • wrapped

      private final InputStream wrapped
    • encrypted

      private byte[] encrypted
    • encryptedPos

      private int encryptedPos
    • encryptedLength

      private int encryptedLength
    • unencrypted

      private byte[] unencrypted
    • unencryptedPos

      private int unencryptedPos
    • int4Buf

      private final byte[] int4Buf
    • lenPos

      private int lenPos
    • int1Buf

      private final byte[] int1Buf
  • Constructor Details

  • Method Details

    • read

      public int read() throws IOException
      Specified by:
      read in class InputStream
      Throws:
      IOException
    • read

      public int read(byte[] buffer, int pos, int len) throws IOException
      Overrides:
      read in class InputStream
      Throws:
      IOException
    • readLength

      private int readLength() throws IOException
      Reads the length of the wrapper message.
      Returns:
      -1 of end of stream reached, 0 if length is not fully read yet, and 1 if length is fully read
      Throws:
      IOException - if read fails
    • readEncryptedBytesAndUnwrap

      private int readEncryptedBytesAndUnwrap() throws IOException
      Reads the encrypted message, and unwraps it.
      Returns:
      -1 of end of stream reached, 0 if the message is not fully read yet, and 1 if length is fully read
      Throws:
      IOException - if read fails