Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework.interfaces
Interface ILineWriter


public interface ILineWriter

The ILineWriter interface defines the API for line-oriented writing of an OutputStream. An instance of ILineWriter can be created using the FactoryUtility singleton.

 FactoryUtility utility = FactoryUtility.getInstance();
 OutputStream stream = ...
 try {
   ILineWriter writer = utility.createLineWriter(stream);
   try {
     ...
   } finally {
     writer.close();
   }
 } catch (IOException exception) {
   ...
 }
 
Lines are written to the stream using either write(String) or writeLine(String). The method newLine() is used to add a new line to the stream. Flushing the stream is done using the method flush(), although this is implied when the close() method is called.

See Also:
FactoryUtility

Method Summary
 void close()
          Close the receiver.
 void flush()
          Flush the receiver.
 void newLine()
          Write a new line.
 void write(String line)
          Write a line of text.
 void writeLine(String line)
          Write a line of text, followed by a new line.
 

Method Detail

close

void close()
           throws IOException
Close the receiver.

Throws:
IOException

flush

void flush()
           throws IOException
Flush the receiver.

Throws:
IOException

newLine

void newLine()
             throws IOException
Write a new line.

Throws:
IOException

write

void write(String line)
           throws IOException
Write a line of text.

Parameters:
line - The line of text to write.
Throws:
IOException

writeLine

void writeLine(String line)
               throws IOException
Write a line of text, followed by a new line.

Parameters:
line - The line of text to write.
Throws:
IOException

Service Activator Toolkit
Version 1.1.0 (20081206)