Package org.postgresql.gss
Class GSSInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.postgresql.gss.GSSInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class GSSInputStream extends java.io.InputStream
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
encrypted
private int
encryptedLength
private int
encryptedPos
private org.ietf.jgss.GSSContext
gssContext
private byte[]
int1Buf
private byte[]
int4Buf
private int
lenPos
private org.ietf.jgss.MessageProp
messageProp
private byte[]
unencrypted
private int
unencryptedPos
private java.io.InputStream
wrapped
-
Constructor Summary
Constructors Constructor Description GSSInputStream(java.io.InputStream wrapped, org.ietf.jgss.GSSContext gssContext, org.ietf.jgss.MessageProp messageProp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
int
read(byte[] buffer, int pos, int len)
private int
readEncryptedBytesAndUnwrap()
Reads the encrypted message, and unwraps it.private int
readLength()
Reads the length of the wrapper message.
-
-
-
Field Detail
-
gssContext
private final org.ietf.jgss.GSSContext gssContext
-
messageProp
private final org.ietf.jgss.MessageProp messageProp
-
wrapped
private final java.io.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
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] buffer, int pos, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
readLength
private int readLength() throws java.io.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:
java.io.IOException
- if read fails
-
readEncryptedBytesAndUnwrap
private int readEncryptedBytesAndUnwrap() throws java.io.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:
java.io.IOException
- if read fails
-
-