Home | History | Annotate | Download | only in xz
      1 /*
      2  * X86Options
      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.X86;
     14 
     15 /**
     16  * BCJ filter for x86 (32-bit and 64-bit) instructions.
     17  */
     18 public class X86Options extends BCJOptions {
     19     private static final int ALIGNMENT = 1;
     20 
     21     public X86Options() {
     22         super(ALIGNMENT);
     23     }
     24 
     25     public FinishableOutputStream getOutputStream(FinishableOutputStream out) {
     26         return new SimpleOutputStream(out, new X86(true, startOffset));
     27     }
     28 
     29     public InputStream getInputStream(InputStream in) {
     30         return new SimpleInputStream(in, new X86(false, startOffset));
     31     }
     32 
     33     FilterEncoder getFilterEncoder() {
     34         return new BCJEncoder(this, BCJCoder.X86_FILTER_ID);
     35     }
     36 }
     37