it.lilik.capturemjpeg
Class MJPEGInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by it.lilik.capturemjpeg.MJPEGInputStream
All Implemented Interfaces:
Closeable

public class MJPEGInputStream
extends FilterInputStream

This class provides the method byte[] readImage() which returns a byte array containing a complete JPEG image extracted from the InputStream provided, which should be a MotionJPEG stream.

Author:
Alessio Caiazza, Cosimo Cecchi

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
MJPEGInputStream(InputStream arg0, String boundary)
          Creates a MotionJPEG parser from arg0 InputStream
 
Method Summary
 byte[] readImage()
          Returns a byte array containing the next JPEG image.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MJPEGInputStream

public MJPEGInputStream(InputStream arg0,
                        String boundary)
Creates a MotionJPEG parser from arg0 InputStream

Parameters:
arg0 -
boundary - the boundary string delimiting every images
Method Detail

readImage

public byte[] readImage()
                 throws IOException
Returns a byte array containing the next JPEG image.

Returns:
a byte array containing the next JPEG image
Throws:
IOException - if no image is available


Copyright © 2008-09 Alessio Caiazza, Cosimo Cecchi All Rights Reserved.