com.credibledoc.iso8583packer.bitmap.BitmapPacker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iso-8583-packer Show documentation
Show all versions of iso-8583-packer Show documentation
Helps to define message structure in ISO 8583 and other formats.
package com.credibledoc.iso8583packer.bitmap;
import com.credibledoc.iso8583packer.message.MsgValue;
import java.util.BitSet;
/**
* Packs and unpacks BitSet, see the Wikipedia description.
*
* Actual documentation and examples
* bitmap-packer.md.
*
* @author Kyrylo Semenko
*/
public interface BitmapPacker {
/**
* @param bitSet the {@link BitSet} for packing
* @return packed {@link BitSet}
*/
byte[] pack (BitSet bitSet);
/**
* @param msgValue where the unpacked {@link BitSet} will be stored
* @param bytes the data source
* @param offset starting offset within the bytes
* @return number of consumed bytes
*/
int unpack(MsgValue msgValue, byte[] bytes, int offset);
/**
* @return The number of the {@link BitSet} bytes in a packed state without the children of the {@link BitmapPacker}.
*/
int getPackedBytesLength();
}