Holger's Java API

## com.antelmann.image
Class MJPEGReader

    java.lang.Object
      com.antelmann.image.MJPEGReader

All Implemented Interfaces:
  Closeable, Runnable

    public class MJPEGReader

extends Object
implements Runnable, Closeable

a special reader that allows to extract the jpg image data from a MJPEG encoded input stream

Since:
  07.09.2010, 00:07:15
Author:
  Holger Antelmann

Constructor Summary
`MJPEGReader(InputStream in, byte[] separatorPattern)`
`MJPEGReader(InputStream in, byte[] separatorPattern, Handler<byte[],? extends IOException> handler)`

Method Summary
`void` `close()`
`protected void` `copy(int streamByte)`
`long` `getBytesRead()`
`Vector<OutputStream>` `getCopyStreams()`
`Monitor` `getMonitor()`
`byte[]` `getSeparatorPattern()`
`BufferedInputStream` `getStream()`
`void` `resetBytesRead()`
`void` `run()`
`void` `setHandler(Handler<byte[],? extends IOException> handler)`
`void` `setStream(BufferedInputStream stream)`
`void` `setStream(InputStream in)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MJPEGReader

    public MJPEGReader(InputStream in,
                       byte[] separatorPattern)

### MJPEGReader

    public MJPEGReader(InputStream in,
                       byte[] separatorPattern,
                       Handler<byte[],? extends IOException> handler)

Method Detail

### setStream

    public void setStream(InputStream in)

### getStream

    public BufferedInputStream getStream()

### setStream

    public void setStream(BufferedInputStream stream)

### close

    public void close()
               throws IOException

  Specified by:
    `close` in interface `Closeable`
  Throws:
    `IOException`

### setHandler

    public void setHandler(Handler<byte[],? extends IOException> handler)

### getCopyStreams

    public Vector<OutputStream> getCopyStreams()

### getSeparatorPattern

    public byte[] getSeparatorPattern()

### getMonitor

    public Monitor getMonitor()

### run

    public void run()

  Specified by:
    `run` in interface `Runnable`

### getBytesRead

    public long getBytesRead()

### resetBytesRead

    public void resetBytesRead()

### copy

    protected void copy(int streamByte)

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads