public interface ChannelOutputInt extends Poisonable
A writing-end, conforming to this interface, is obtained from a channel by invoking its out() method.
ChannelOutputInt variables are used to hold integer channels that are going to be used only for output by the declaring process. This is a security matter -- by declaring a ChannelOutputInt interface, any attempt to input from the channel will generate a compile-time error. For example, the following code fragment will not compile:
int doRead (ChannelOutputInt c) { return c.read (); // illegal }When configuring a CSProcess with output integer channels, they should be declared as ChannelOutputInt variables. The actual channel passed, of course, may belong to any channel class that implements ChannelOutputInt.
void doWrite (ChannelOutputInt c, int i) { c.write (i); }
SharedChannelOutputInt
,
ChannelInputInt
Modifier and Type | Method and Description |
---|---|
void |
write(int i)
Write an int to the channel.
|
poison
Copyright © 1996–2022. All rights reserved.