Class ConnectionMetadata (0.6.1)

public class ConnectionMetadata implements AutoCloseable

Inheritance

java.lang.Object > ConnectionMetadata

Implements

AutoCloseable

Constructors

ConnectionMetadata(InputStream rawInputStream, OutputStream rawOutputStream)

public ConnectionMetadata(InputStream rawInputStream, OutputStream rawOutputStream)

Creates a DataInputStream and a DataOutputStream from the given raw streams and pushes these as the current streams to use for communication for a connection.

Parameters
NameDescription
rawInputStreamInputStream
rawOutputStreamOutputStream

Methods

close()

public void close()
Exceptions
TypeDescription
Exception

peekInputStream()

public DataInputStream peekInputStream()

Returns the current DataInputStream for the connection.

Returns
TypeDescription
DataInputStream

peekOutputStream()

public DataOutputStream peekOutputStream()

Returns the current DataOutputStream for the connection.

Returns
TypeDescription
DataOutputStream

popStreams()

public Tuple<DataInputStream,DataOutputStream> popStreams()

Pops the current DataInputStream and DataOutputStream from the connection. This is done when the COPY sub-protocol has finished.

Returns
TypeDescription
com.google.cloud.Tuple<DataInputStream,DataOutputStream>

pushNewStreams()

public Tuple<DataInputStream,DataOutputStream> pushNewStreams()

Creates a new buffered DataInputStream and DataOutputStream tuple to use for the connection. This is used for the COPY sub-protocol to prevent mixing the buffers used for the normal protocol with the COPY protocol, as that would cause multithreaded access to those buffers.

Returns
TypeDescription
com.google.cloud.Tuple<DataInputStream,DataOutputStream>