net.sourceforge.openstego
Class StegoOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bynet.sourceforge.openstego.StegoOutputStream

public class StegoOutputStream
extends java.io.OutputStream

OutputStream to embed data into image


Constructor Summary
StegoOutputStream(java.awt.image.BufferedImage image, int dataLength, java.lang.String fileName, OpenStegoConfig config)
          Default constructor
 
Method Summary
 void close()
          Closes the stream
 void flush()
          Flushes the stream
 java.awt.image.BufferedImage getImage()
          Get the image containing the embedded data.
 void write(int data)
          Implementation of OutputStream.write(int) method
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StegoOutputStream

public StegoOutputStream(java.awt.image.BufferedImage image,
                         int dataLength,
                         java.lang.String fileName,
                         OpenStegoConfig config)
                  throws OpenStegoException
Default constructor

Parameters:
image - Source image into which data will be embedded
dataLength - Length of the data that would be written to the image
fileName - Name of the source data file
config - Configuration data to use while writing
Throws:
OpenStegoException
Method Detail

write

public void write(int data)
           throws java.io.IOException
Implementation of OutputStream.write(int) method

Parameters:
data - Byte to be written
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes the stream

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the stream

Throws:
java.io.IOException

getImage

public java.awt.image.BufferedImage getImage()
                                      throws OpenStegoException
Get the image containing the embedded data. Ideally, this should be called after the stream is closed.

Returns:
Image data
Throws:
OpenStegoException