public static BufferedImage byteArrayToImage(byte[] imageData,String imgFileName) throws OpenStegoException {
  BufferedImage image=null;
  try {
    if (imageData == null) {
      return null;
    }
    image=ImageIO.read(new ByteArrayInputStream(imageData));
    if (image == null) {
      throw new OpenStegoException(null,OpenStego.NAMESPACE,OpenStegoException.IMAGE_FILE_INVALID,imgFileName);
    }
    return image;
  }
 catch (  IOException ioEx) {
    throw new OpenStegoException(ioEx);
  }
}

public static BufferedImage byteArrayToImage ( byte [ ] imageData , String imgFileName ) throws OpenStegoException { BufferedImage image = null ; try { if ( imageData == null ) { return null ; } image = ImageIO . read ( new ByteArrayInputStream ( imageData ) ) ; if ( image == null ) { throw new OpenStegoException ( null , OpenStego . NAMESPACE , OpenStegoException . IMAGE_FILE_INVALID , imgFileName ) ; } return image ; } catch ( IOException ioEx ) { throw new OpenStegoException ( ioEx ) ; } }
method to convert byte array to image
