Package org.postgresql.gss
Class GSSOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.postgresql.util.internal.PgBufferedOutputStream
org.postgresql.gss.GSSOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Output stream that wraps each packed with GSS encryption.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GSSContext
private final MessageProp
private final PgBufferedOutputStream
Fields inherited from class org.postgresql.util.internal.PgBufferedOutputStream
buf, count
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorsConstructorDescriptionGSSOutputStream
(PgBufferedOutputStream out, GSSContext gssContext, MessageProp messageProp, int maxTokenSize) Creates GSS output stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
private static int
getBufferSize
(GSSContext gssContext, 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 org.postgresql.util.internal.PgBufferedOutputStream
flush, write, write, writeInt2, writeInt4, writeZeros
Methods inherited from class java.io.FilterOutputStream
close, write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
pgOut
-
gssContext
-
messageProp
-
-
Constructor Details
-
GSSOutputStream
public GSSOutputStream(PgBufferedOutputStream out, GSSContext gssContext, MessageProp messageProp, int maxTokenSize) throws GSSException Creates GSS output stream.- Parameters:
out
- output stream for the encrypted datagssContext
- gss contextmessageProp
- message propertiesmaxTokenSize
- maximum length of the encrypted messages- Throws:
GSSException
-
-
Method Details
-
getBufferSize
private static int getBufferSize(GSSContext gssContext, MessageProp messageProp, int maxTokenSize) throws GSSException - Throws:
GSSException
-
flushBuffer
- Overrides:
flushBuffer
in classPgBufferedOutputStream
- Throws:
IOException
-
writeWrapped
- Throws:
IOException
-
write
- Overrides:
write
in classPgBufferedOutputStream
- Throws:
IOException
-