public class OutputStreamByteSenderImpl extends Object implements ByteSender
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
org.refcodes.component.Closable.CloseAutomaton
Constructor and Description |
---|
OutputStreamByteSenderImpl(OutputStream aOutputStream) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
org.refcodes.component.ConnectionStatus |
getConnectionStatus() |
boolean |
isClosable() |
boolean |
isClosed() |
boolean |
isOpened() |
void |
writeDatagram(byte aDatagram)
Writes (sends) a byte to a listening
DatagramReceiver . |
void |
writeDatagrams(byte[] aDatagram)
Writes (sends) a byte block to a listening
DatagramReceiver or
BlockReceiver . |
void |
writeDatagrams(byte[] aDatagram,
int aOffset,
int aLength) |
public OutputStreamByteSenderImpl(OutputStream aOutputStream) throws org.refcodes.component.OpenException
org.refcodes.component.OpenException
public void writeDatagrams(byte[] aDatagram) throws org.refcodes.component.OpenException
ByteBlockSender
DatagramReceiver
or
BlockReceiver
.writeDatagrams
in interface ByteBlockSender
writeDatagrams
in interface ByteSender
aDatagram
- The byte to be pushed to the receiving
DatagramReceiver
or BlockReceiver
.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public boolean isClosed()
isClosed
in interface org.refcodes.component.ClosedAccessor
public boolean isOpened()
isOpened
in interface org.refcodes.component.OpenedAccessor
public org.refcodes.component.ConnectionStatus getConnectionStatus()
getConnectionStatus
in interface org.refcodes.component.ConnectionStatusAccessor
public void writeDatagrams(byte[] aDatagram, int aOffset, int aLength) throws org.refcodes.component.OpenException
writeDatagrams
in interface ByteBlockSender
writeDatagrams
in interface ByteSender
org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
org.refcodes.component.CloseException
public void writeDatagram(byte aDatagram) throws org.refcodes.component.OpenException
ByteDatagramSender
DatagramReceiver
.writeDatagram
in interface ByteDatagramSender
aDatagram
- The byte to be pushed to the receiving
ByteDatagramSender
.org.refcodes.component.OpenException
- Thrown in case opening or accessing an open line
(connection, junction, link) caused problems.public void flush() throws org.refcodes.component.OpenException
public boolean isClosable()
isClosable
in interface org.refcodes.component.Closable.CloseAutomaton
Copyright © 2016. All rights reserved.