Class ConnectionMetadata (0.18.2)

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

getInputStream()

public DataInputStream getInputStream()

Returns the current DataInputStream for the connection.

Returns
TypeDescription
DataInputStream

getOutputStream()

public DataOutputStream getOutputStream()

Returns the current DataOutputStream for the connection.

Returns
TypeDescription
DataOutputStream

markForRestart()

public void markForRestart()

peekNextByte(long maxWaitMillis)

public char peekNextByte(long maxWaitMillis)

Returns the next byte in the input stream without removing it. Returns zero if no bytes are available. This method will wait for up to maxWaitMillis milliseconds to allow pending data to become available in the buffer.

Parameter
NameDescription
maxWaitMillislong
Returns
TypeDescription
char
Exceptions
TypeDescription
IOException