org.ssonet.io
Interface IOStream

All Known Subinterfaces:
Mechanism, SSONETProtocolStream
All Known Implementing Classes:
AbstractAccountabilityMechanism, AbstractConfidentialityMechanism, AbstractIntegrityMechanism, ByteIOStream, IOFilterStream, KeyExchangeTest.TestStream, SSONETProtocolImpl

public interface IOStream

Interface for an Input/Output-Stream for reading and writing byte arrays.


Method Summary
 int available()
           
 void closeIn()
          Closes the Inputstream.
 void closeOut()
          Closes the outputStream.
 int read(byte[] buffer)
          Reads an array of bytes from a stream
 void write(byte[] buffer)
          Writes an array of bytes to a stream.
 

Method Detail

read

public int read(byte[] buffer)
         throws java.io.IOException
Reads an array of bytes from a stream

Parameters:
buffer - the buffer, which shall be filled with bytes read
Returns:
the number of bytes read, or -1 if the End Of Stream is reached.
Throws:
java.io.IOException - if an error occures while reading from the stream

write

public void write(byte[] buffer)
           throws java.io.IOException
Writes an array of bytes to a stream.

Parameters:
buffer - the buffer holding the bytes to write to the stream
Throws:
java.io.IOException - if an error occures while writing to the stream

closeIn

public void closeIn()
             throws java.io.IOException
Closes the Inputstream.

java.io.IOException

closeOut

public void closeOut()
              throws java.io.IOException
Closes the outputStream.

java.io.IOException

available

public int available()
              throws java.io.IOException
Returns:
the number of bytes currently available from the inputstream without blocking.
java.io.IOException


Copyright © 2003 DRIM Team. All Rights Reserved.