package rand.strat;

import rand.StreamStrategy;
import rand.ByteStream;

/**
 * A strategy that modifies the position of the ROM relative to its current
 * position.
 */
public class OffsetStrategy implements StreamStrategy {
    private final StreamStrategy strategy;
    private final int offset;
    
    /**
     * Constructs a new OffsetStrategy that advances the position of the ROM by
     * the given amount, then executes the given strategy.
     * 
     * @param strategy The delegate strategy to use.
     * @param offset The amount to advance the position of the ROM.
     */
    public OffsetStrategy(final StreamStrategy strategy, int offset)
    {
        this.strategy = strategy;
        this.offset = offset;
    }
    
    /**
     * Process the given byte stream.
     * 
     * @param stream The byte stream to execute on.
     */
    @Override
    public void execute(ByteStream stream) {
        stream.advance(this.offset);
        this.strategy.execute(stream);
    }
}

@@ -285,22 +285,51 @@
 nal int 
-offset
+before;%0A    private final int after
 ;%0A    %0A 
@@ -549,22 +549,22 @@
  @param 
-offset
+before
  The amo
@@ -676,84 +676,761 @@
 int 
-offset)%0A    %7B%0A        this.strategy = strategy;%0A        this.offset = offset
+before)%0A    %7B%0A        this(strategy, before, 0);%0A    %7D%0A    %0A    /**%0A     * Constructs a new OffsetStrategy that advances the position of the ROM by%0A     * the given amount, executes the given strategy, then advances the position%0A     * of the ROM by the other given amount.%0A     * %0A     * @param strategy The delegate strategy to use.%0A     * @param before The amount to advance the position of the ROM before%0A     * executing the delegate strategy.%0A     * @param after The amount to advance the position of the ROM after%0A     * executing the delegate strategy.%0A     */%0A    public OffsetStrategy(final StreamStrategy strategy, int before,%0A            int after) %7B%0A        this.strategy = strategy;%0A        this.before = before;%0A        this.after = after
 ;%0A  
@@ -1643,14 +1643,14 @@
 his.
-offset
+before
 );%0A 
@@ -1687,16 +1687,52 @@
 tream);%0A
+        stream.advance(this.after);%0A
     %7D%0A%7D%0A

Add "after" functionality to OffsetStrategy.