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:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class GSSOutputStream extends PgBufferedOutputStream
Output stream that wraps each packed with GSS encryption.
-
-
Field Summary
Fields Modifier and Type Field Description private org.ietf.jgss.GSSContext
gssContext
private org.ietf.jgss.MessageProp
messageProp
private PgBufferedOutputStream
pgOut
-
Fields inherited from class org.postgresql.util.internal.PgBufferedOutputStream
buf, count
-
-
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 org.postgresql.util.internal.PgBufferedOutputStream
flush, write, write, writeInt2, writeInt4, writeZeros
-
-
-
-
Field Detail
-
pgOut
private final PgBufferedOutputStream pgOut
-
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 datagssContext
- gss contextmessageProp
- message propertiesmaxTokenSize
- 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
-
flushBuffer
protected void flushBuffer() throws java.io.IOException
- Overrides:
flushBuffer
in classPgBufferedOutputStream
- Throws:
java.io.IOException
-
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 classPgBufferedOutputStream
- Throws:
java.io.IOException
-
-