Package net.sf.cram.encoding

Source Code of net.sf.cram.encoding.NullEncoding

package net.sf.cram.encoding;

import java.io.InputStream;
import java.util.Map;


import net.sf.cram.EncodingID;
import net.sf.cram.EncodingParams;
import net.sf.cram.io.ExposedByteArrayOutputStream;

public class NullEncoding<T> implements Encoding<T> {
  public static final EncodingID ENCODING_ID = EncodingID.NULL;

  public NullEncoding() {
  }
 
  @Override
  public EncodingID id() {
    return ENCODING_ID;
  }

  public static EncodingParams toParam() {
    return new EncodingParams(ENCODING_ID, new NullEncoding().toByteArray());
  }

  @Override
  public byte[] toByteArray() {
    return new byte[] {};
  }

  @Override
  public void fromByteArray(byte[] data) {
  }

  @Override
  public BitCodec<T> buildCodec(Map<Integer, InputStream> inputMap,
      Map<Integer, ExposedByteArrayOutputStream> outputMap) {
    return new NullCodec<T>();
  }

}
TOP

Related Classes of net.sf.cram.encoding.NullEncoding

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.