com.day.cq.dam.commons.handler
Class XPacketFilter

java.lang.Object
  extended by com.day.cq.dam.commons.handler.AbstractFilter
      extended by com.day.cq.dam.commons.handler.XPacketFilter
All Implemented Interfaces:
Filter

public class XPacketFilter
extends AbstractFilter

Continuously process bytes received from an InputStream and write the ones contained in an xpacket to an OutputStream.

Author:
dpfister

Field Summary
 
Fields inherited from class com.day.cq.dam.commons.handler.AbstractFilter
autoReset, listener, nextFilter, out, streamPos
 
Constructor Summary
XPacketFilter()
           
 
Method Summary
protected  void doFilter(byte[] buf, int off, int len)
          Write a couple of bytes to this filter and process them (overridable).
protected  void doReset()
          Reset internal state of this filter.
 boolean isValid()
          Return a flag indicating whether the contents processed by this filter represents a valid entity.
 
Methods inherited from class com.day.cq.dam.commons.handler.AbstractFilter
filter, notifyEnded, notifyStarted, put, put, put, reset, setAutoReset, setFilterStateListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPacketFilter

public XPacketFilter()
Method Detail

doFilter

protected void doFilter(byte[] buf,
                        int off,
                        int len)
                 throws IOException
Write a couple of bytes to this filter and process them (overridable).

Specified by:
doFilter in class AbstractFilter
Parameters:
buf - buffer
off - offset inside buffer
len - number of bytes
Throws:
IOException - if an error occurs

doReset

protected void doReset()
Reset internal state of this filter. Default implementation clears output stream returned from a listener notification Reset internal state.

Overrides:
doReset in class AbstractFilter

isValid

public boolean isValid()
Return a flag indicating whether the contents processed by this filter represents a valid entity. This implementation returns true. Contents is only valid if the state equals ParseState#END.

Specified by:
isValid in interface Filter
Overrides:
isValid in class AbstractFilter
Returns:
true if the contents is valid; false otherwise.


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.