Class BaseHeader
java.lang.Object
org.jpos.iso.header.BaseHeader
- All Implemented Interfaces:
Serializable, Cloneable, ISOHeader, Loggeable
- Direct Known Subclasses:
BASE1Header
Base implementation of
ISOHeader providing common header handling for ISO-8583 channels.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.BaseHeader(byte[] header) Creates a BaseHeader wrapping the given raw bytes. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of this ISOHeader.voiddump(PrintStream p, String indent) Dumps a human-readable representation of this object to the print stream.Returns the destination address in this ISOHeader.intReturns the number of bytes in this ISOHeader when packed.Returns the source address in this ISOHeader.booleanReturns true if ASCII encoding is used for source/destination fields.byte[]pack()Packs this header into a byte array.voidsetAsciiEncoding(boolean asciiEncoding) Sets the encoding for source/destination fields.voidsetDestination(String dst) Sets the destination address in this ISOHeader.voidSets the source address in this ISOHeader.voidSwaps the source and destination addresses in this ISOHeader (if they exist).intunpack(byte[] header) Unpacks the header from a raw byte array.Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Loggeable
dumpModifier and TypeMethodDescriptiondefault voiddump(PrintStream p, String indent, LogRenderer.Type type) Dumps a representation of this object using the specified renderer type.
-
Field Details
-
header
Raw header bytes.
-
-
Constructor Details
-
BaseHeader
public BaseHeader()Default Constructor. Used by Class.forName.newInstance(...); -
BaseHeader
Creates a BaseHeader wrapping the given raw bytes.- Parameters:
header- raw header bytes
-
-
Method Details
-
clone
-
pack
-
unpack
-
getLength
-
setDestination
Description copied from interface:ISOHeaderSets the destination address in this ISOHeader.- Specified by:
setDestinationin interfaceISOHeader- Parameters:
dst- the destination address
-
setSource
-
getDestination
Description copied from interface:ISOHeaderReturns the destination address in this ISOHeader.- Specified by:
getDestinationin interfaceISOHeader- Returns:
- the destination address, or null if not set
-
getSource
-
swapDirection
Description copied from interface:ISOHeaderSwaps the source and destination addresses in this ISOHeader (if they exist).- Specified by:
swapDirectionin interfaceISOHeader
-
dump
-
setAsciiEncoding
Sets the encoding for source/destination fields.- Parameters:
asciiEncoding- true for ASCII, false for BCD
-
isAsciiEncoding
Returns true if ASCII encoding is used for source/destination fields.- Returns:
- true if ASCII encoding is active
-