org.archive.wayback.replay.swf
Class RobustMovieDecoder

java.lang.Object
  extended by org.archive.wayback.replay.swf.RobustMovieDecoder
All Implemented Interfaces:
com.flagstone.transform.coder.SWFFactory<com.flagstone.transform.MovieTag>

public class RobustMovieDecoder
extends Object
implements com.flagstone.transform.coder.SWFFactory<com.flagstone.transform.MovieTag>

Author:
brad

Field Summary
static int DECODE_RULE
          Decoding robustness/sloppiness factor.
static int DECODE_RULE_LAX
          Allow arbitrary trailing values in decoded tags - attempt anything.
static int DECODE_RULE_NULLS
          Allow trailing NULL values in decoded tags.
static int DECODE_RULE_STRICT
          Allow no unparsed data - very strict decoding.
 
Constructor Summary
RobustMovieDecoder()
           
 
Method Summary
 void getObject(List<com.flagstone.transform.MovieTag> list, com.flagstone.transform.coder.SWFDecoder coder, com.flagstone.transform.coder.Context context)
           
 void setDecodeRule(int decodeRule)
           
 void setDelegate(com.flagstone.transform.coder.SWFFactory<com.flagstone.transform.MovieTag> delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DECODE_RULE

public static final int DECODE_RULE
Decoding robustness/sloppiness factor.

See Also:
Constant Field Values

DECODE_RULE_STRICT

public static final int DECODE_RULE_STRICT
Allow no unparsed data - very strict decoding.

See Also:
Constant Field Values

DECODE_RULE_NULLS

public static final int DECODE_RULE_NULLS
Allow trailing NULL values in decoded tags.

See Also:
Constant Field Values

DECODE_RULE_LAX

public static final int DECODE_RULE_LAX
Allow arbitrary trailing values in decoded tags - attempt anything.

See Also:
Constant Field Values
Constructor Detail

RobustMovieDecoder

public RobustMovieDecoder()
Method Detail

setDecodeRule

public void setDecodeRule(int decodeRule)
Parameters:
decodeRule - the robustness level to use for re-aligning the decoder. MovieDecoder just chokes if a given tag has trailing data - does not need as many bytes as it declares it has. This decorator will attempt to realign by either: 1) LAX - chewing up *any* bytes to realign 2) NULLS - chewing up only trailing NULL bytes trailing the tag 3) STRICT - throw exception if an realignment is required.

setDelegate

public void setDelegate(com.flagstone.transform.coder.SWFFactory<com.flagstone.transform.MovieTag> delegate)
Parameters:
delegate - the underlying/wrapped MovieDecoder which does the heavy lifting to parse out tags.

getObject

public void getObject(List<com.flagstone.transform.MovieTag> list,
                      com.flagstone.transform.coder.SWFDecoder coder,
                      com.flagstone.transform.coder.Context context)
               throws IOException
Specified by:
getObject in interface com.flagstone.transform.coder.SWFFactory<com.flagstone.transform.MovieTag>
Throws:
IOException


Copyright © 2005-2011 Internet Archive. All Rights Reserved.