Top Description Fields Constructors Methods
org.freedesktop.dbus.spi.message

public abstract Class AbstractInputStreamMessageReader

extends Object
implements IMessageReader
Class Inheritance
All Implemented Interfaces
org.freedesktop.dbus.spi.message.IMessageReader, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
org.freedesktop.dbus.spi.message.InputStreamMessageReader
Imports
org.freedesktop.dbus.FileDescriptor, org.freedesktop.dbus.exceptions.DBusException, .MessageProtocolVersionException, org.freedesktop.dbus.messages.Message, .MessageFactory, org.slf4j.Logger, .LoggerFactory, java.io.EOFException, .IOException, java.net.SocketTimeoutException, java.nio.ByteBuffer, java.nio.channels.SocketChannel, java.util.*

Base class which can be used to implement a custom message reader.
Since
4.3.1 - 2023-08-07

Field Summary

Modifier and TypeField and Description
private byte[]
private final byte[]
private byte[]
private final SocketChannel
private final int[]
private final Logger
private final ISocketProvider
private final byte[]

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

protected Logger
protected ISocketProvider
public boolean
protected abstract List<FileDescriptor>

Returns:

List or null
readFileDescriptors
(SocketChannel
input channel to read
_inputChannel
)

Methods which will be called when file descriptor passing is enabled.

public final Message
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bodyback to summary
private byte[] body
bufback to summary
private final byte[] buf
inputChannelback to summary
private final SocketChannel inputChannel
lenback to summary
private final int[] len
loggerback to summary
private final Logger logger
socketProviderImplback to summary
private final ISocketProvider socketProviderImpl
tbufback to summary
private final byte[] tbuf

Constructor Detail

AbstractInputStreamMessageReaderback to summary
protected AbstractInputStreamMessageReader(final SocketChannel _in, ISocketProvider _socketProviderImpl)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getLoggerback to summary
protected Logger getLogger()
getSocketProviderImplback to summary
protected ISocketProvider getSocketProviderImpl()
isClosedback to summary
public boolean isClosed()

Implements org.freedesktop.dbus.spi.message.IMessageReader.isClosed.

Annotations
@Override
readFileDescriptorsback to summary
protected abstract List<FileDescriptor> readFileDescriptors(SocketChannel _inputChannel) throws DBusException

Methods which will be called when file descriptor passing is enabled. The implementation should fetch all file descriptors which have been transmitted and return them as List. If no file descriptor is available or feature is not supported, return null.

Parameters
_inputChannel:SocketChannel

input channel to read

Returns:List<FileDescriptor>

List or null

Exceptions
DBusException:
when reading throws exceptions
readMessageback to summary
public final Message readMessage() throws IOException, DBusException

Implements org.freedesktop.dbus.spi.message.IMessageReader.readMessage.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override