Package org.libvirt

Class Stream

All Implemented Interfaces:
Closeable, AutoCloseable, ByteChannel, Channel, ReadableByteChannel, WritableByteChannel

public class Stream extends Object implements ByteChannel
The Stream class is used to transfer data between a libvirt daemon and a client.

It implements the ByteChannel interface.

Basic usage:

 ByteBuffer buf = ByteBuffer.allocate(1024);
 Stream str = conn.streamNew(0);

 ... // open the stream e.g. calling Domain.screenshot

 while ( != -1) {
     ... // do something with the data

If you want to use this class as an InputStream or OutputStream, convert it using the Channels.newInputStream and Channels.newOutputStream respectively.