Class ConnectionMetadata (0.17.0)

publicclass ConnectionMetadataimplementsAutoCloseable

Inheritance

java.lang.Object > ConnectionMetadata

Implements

AutoCloseable

Constructors

ConnectionMetadata(InputStream rawInputStream, OutputStream rawOutputStream)

publicConnectionMetadata(InputStreamrawInputStream,OutputStreamrawOutputStream)

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
Name Description
rawInputStream InputStream
rawOutputStream OutputStream

Methods

close()

publicvoidclose()
Exceptions
Type Description

getInputStream()

publicDataInputStreamgetInputStream()

Returns the current DataInputStream for the connection.

Returns
Type Description

getOutputStream()

publicDataOutputStreamgetOutputStream()

Returns the current DataOutputStream for the connection.

Returns
Type Description

markForRestart()

publicvoidmarkForRestart()

peekNextByte(long maxWaitMillis)

publiccharpeekNextByte(longmaxWaitMillis)

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
Name Description
maxWaitMillis long
Returns
Type Description
Exceptions
Type Description

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.