1 /* 2 * ARMThumbOptions 3 * 4 * Author: Lasse Collin <lasse.collin (at) tukaani.org> 5 * 6 * This file has been put into the public domain. 7 * You can do whatever you want with this file. 8 */ 9 10 package org.tukaani.xz; 11 12 import java.io.InputStream; 13 import org.tukaani.xz.simple.ARMThumb; 14 15 /** 16 * BCJ filter for little endian ARM-Thumb instructions. 17 */ 18 public class ARMThumbOptions extends BCJOptions { 19 private static final int ALIGNMENT = 2; 20 21 public ARMThumbOptions() { 22 super(ALIGNMENT); 23 } 24 25 public FinishableOutputStream getOutputStream(FinishableOutputStream out, 26 ArrayCache arrayCache) { 27 return new SimpleOutputStream(out, new ARMThumb(true, startOffset)); 28 } 29 30 public InputStream getInputStream(InputStream in, ArrayCache arrayCache) { 31 return new SimpleInputStream(in, new ARMThumb(false, startOffset)); 32 } 33 34 FilterEncoder getFilterEncoder() { 35 return new BCJEncoder(this, BCJCoder.ARMTHUMB_FILTER_ID); 36 } 37 } 38