Class PipeConnection
- java.lang.Object
-
- com.sun.star.lib.connections.pipe.PipeConnection
-
- All Implemented Interfaces:
com.sun.star.connection.XConnection
,com.sun.star.connection.XConnectionBroadcaster
,com.sun.star.uno.XInterface
public class PipeConnection extends java.lang.Object implements com.sun.star.connection.XConnection, com.sun.star.connection.XConnectionBroadcaster
The PipeConnection implements theXConnection
interface and is uses by thePipeConnector
and thePipeAcceptor
. This class is not part of the providedapi
. The native implementation is in jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c- Since:
- UDK1.0
- See Also:
pipeAcceptor
,pipeConnector
,XConnection
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_aDescription
protected java.util.ArrayList<com.sun.star.io.XStreamListener>
_aListeners
protected boolean
_bFirstRead
protected long
_nPipeHandle
static boolean
DEBUG
When set to true, enables various debugging output.
-
Constructor Summary
Constructors Constructor Description PipeConnection(java.lang.String description)
Constructs a newPipeConnection
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStreamListener(com.sun.star.io.XStreamListener aListener)
void
close()
Closes the connection.void
flush()
Flushes the buffer.java.lang.String
getDescription()
Gives a description of the connection.int
read(byte[][] bytes, int nBytesToRead)
Read the required number of bytes.void
removeStreamListener(com.sun.star.io.XStreamListener aListener)
void
write(byte[] aData)
Write bytes.
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
When set to true, enables various debugging output.- See Also:
- Constant Field Values
-
_aDescription
protected java.lang.String _aDescription
-
_nPipeHandle
protected long _nPipeHandle
-
_aListeners
protected java.util.ArrayList<com.sun.star.io.XStreamListener> _aListeners
-
_bFirstRead
protected boolean _bFirstRead
-
-
Method Detail
-
addStreamListener
public void addStreamListener(com.sun.star.io.XStreamListener aListener) throws com.sun.star.uno.RuntimeException
- Specified by:
addStreamListener
in interfacecom.sun.star.connection.XConnectionBroadcaster
- Throws:
com.sun.star.uno.RuntimeException
-
removeStreamListener
public void removeStreamListener(com.sun.star.io.XStreamListener aListener) throws com.sun.star.uno.RuntimeException
- Specified by:
removeStreamListener
in interfacecom.sun.star.connection.XConnectionBroadcaster
- Throws:
com.sun.star.uno.RuntimeException
-
read
public int read(byte[][] bytes, int nBytesToRead) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
Read the required number of bytes.- Specified by:
read
in interfacecom.sun.star.connection.XConnection
- Parameters:
bytes
- the outparameter, where the bytes have to be placed.nBytesToRead
- the number of bytes to read.- Returns:
- the number of bytes read.
- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
XConnection.read(byte[][], int)
-
write
public void write(byte[] aData) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
Write bytes.- Specified by:
write
in interfacecom.sun.star.connection.XConnection
- Parameters:
aData
- the bytes to write.- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
XConnection.write(byte[])
-
flush
public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
Flushes the buffer.- Specified by:
flush
in interfacecom.sun.star.connection.XConnection
- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
XConnection.flush()
-
close
public void close() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException
Closes the connection.- Specified by:
close
in interfacecom.sun.star.connection.XConnection
- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
XConnection.close()
-
getDescription
public java.lang.String getDescription() throws com.sun.star.uno.RuntimeException
Gives a description of the connection.- Specified by:
getDescription
in interfacecom.sun.star.connection.XConnection
- Returns:
- the description.
- Throws:
com.sun.star.uno.RuntimeException
- See Also:
XConnection.getDescription()
-
-