|
1.0.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConnectionService
The ConnectionService interface defines the ConnectionService concept. A ConnectionService is an encapsulation of a pair of streams, one input and one output. A user of a connection can open and close a connection, get each stream, and test if a stream is open. Generally, after opening a ConnectionService, and getting the streams, a ConnectionService user will read and write to the streams, closing the ConnectionService when finished.
Connection| Field Summary | |
|---|---|
static java.lang.String |
CONNECTION_KEY
Define the connection key (String) constant. |
static java.lang.String |
DEFAULT_CONNECTION
Define the default connection (String) constant. |
static java.lang.String |
SERVICE_NAME
Define the OSGi service name. |
| Method Summary | |
|---|---|
void |
close()
Perform the close action method. |
void |
exit()
Request the connection to exit. |
void |
flush()
Flush any data to be written. |
boolean |
isOpen()
Gets the boolean open property value. |
void |
open()
Perform the open action method. |
int |
read(byte[] bytes)
Read data into the bytes specified. |
int |
read(byte[] bytes,
int offset,
int length)
Read data into the bytes specified. |
void |
write(byte[] bytes)
Writes the bytes from the byte array. |
void |
write(byte[] bytes,
int offset,
int count)
Writes count bytes from the byte array
buffer starting at offset. |
| Field Detail |
|---|
static final java.lang.String SERVICE_NAME
static final java.lang.String CONNECTION_KEY
static final java.lang.String DEFAULT_CONNECTION
| Method Detail |
|---|
void close()
throws java.io.IOException
java.io.IOException
void exit()
throws java.io.IOException
IOException.
java.io.IOException
void flush()
throws java.io.IOException
java.io.IOExceptionboolean isOpen()
boolean open property value. This API returns a
boolean which tells whether or not the ConnectionService contains valid,
open streams.
boolean) value.
void open()
throws java.io.IOException
java.io.IOException
int read(byte[] bytes)
throws java.io.IOException
bytes - The bytes (byte[]) parameter.
java.io.IOExceptionread(byte[],int,int)
int read(byte[] bytes,
int offset,
int length)
throws java.io.IOException
b to store the read bytes.
the maximum number of bytes to store in b.
bytes - The bytes (byte[]) parameter.offset - The offset (int) parameter.length - The length (int) parameter.
java.io.IOExceptionread(byte[])
void write(byte[] bytes)
throws java.io.IOException
bytes from the byte array.
the buffer to be written
an error occurs attempting to write to this OutputStream.
If offset or count are outside of bounds.
bytes - The bytes (byte[]) parameter.
java.io.IOExceptionwrite(byte[],int,int)
void write(byte[] bytes,
int offset,
int count)
throws java.io.IOException
count bytes from the byte array
buffer starting at offset.
the buffer to be written
offset in buffer to get bytes
number of bytes in buffer to write
an error occurs attempting to write to this OutputStream.
If offset or count are outside of bounds.
bytes - The bytes (byte[]) parameter.offset - The offset (int) parameter.count - The count (int) parameter.
java.io.IOExceptionwrite(byte[])
|
1.0.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||