Class IFEP_LLLBINARY
java.lang.Object
org.jpos.iso.ISOFieldPackager
org.jpos.iso.ISOBinaryFieldPackager
org.jpos.iso.IFEP_LLLBINARY
- All Implemented Interfaces:
GenericPackagerParams
EBCDIC LLLVAR binary field packager with a two-byte tag header.
-
Field Summary
Fields inherited from class ISOFieldPackager
pad, trim -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.IFEP_LLLBINARY(int length, String description) Constructs a packager with the given length and description.IFEP_LLLBINARY(int length, String description, BinaryInterpreter binaryInterpreter, Prefixer prefixer) Constructs a packager with custom interpreter and prefixer. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of bytes this packager can produce.byte[]pack(ISOComponent c) Convert the component into a byte[].voidApplies packager configuration from the SAX attributes of the packager XML element.intunpack(ISOComponent c, byte[] b, int offset) Unpacks a field from the binary image into the given component.voidunpack(ISOComponent c, InputStream in) Unpack from an input streamMethods inherited from class ISOBinaryFieldPackager
checkLength, createComponent, setInterpreter, setPrefixerModifier and TypeMethodDescriptionprotected voidcheckLength(int len, int maxLength) Checks the length of the data against the maximum, and throws an IllegalArgumentException.createComponent(int fieldNumber) component factoryvoidsetInterpreter(BinaryInterpreter interpreter) Sets the Interpreter.voidsetPrefixer(Prefixer prefixer) Sets the length prefixer.Methods inherited from class ISOFieldPackager
getDescription, getLength, pack, readBytes, setDescription, setLength, setPad, setTrimModifier and TypeMethodDescriptionReturns the field description.intReturns the maximum field length.voidpack(ISOComponent c, ObjectOutput out) Packs the component to an ObjectOutput stream.protected byte[]readBytes(InputStream in, int l) Reads exactlylbytes from the input stream.voidsetDescription(String description) Sets the field description.voidsetLength(int len) Sets the maximum field length.voidsetPad(boolean pad) Enables or disables padding for this field.voidsetTrim(boolean trim) Enables or disables trimming for this field.
-
Constructor Details
-
IFEP_LLLBINARY
public IFEP_LLLBINARY()Default constructor. -
IFEP_LLLBINARY
Constructs a packager with the given length and description.- Parameters:
length- field lengthdescription- field description
-
IFEP_LLLBINARY
public IFEP_LLLBINARY(int length, String description, BinaryInterpreter binaryInterpreter, Prefixer prefixer) Constructs a packager with custom interpreter and prefixer.- Parameters:
length- field lengthdescription- field descriptionbinaryInterpreter- binary interpreterprefixer- length prefixer
-
-
Method Details
-
setGenericPackagerParams
Description copied from interface:GenericPackagerParamsApplies packager configuration from the SAX attributes of the packager XML element.- Specified by:
setGenericPackagerParamsin interfaceGenericPackagerParams- Parameters:
atts- the SAX attributes from the packager element
-
pack
Description copied from class:ISOBinaryFieldPackagerConvert the component into a byte[].- Overrides:
packin classISOBinaryFieldPackager- Parameters:
c- - a component- Returns:
- packed component
- Throws:
ISOException- on ISO processing error
-
unpack
Description copied from class:ISOFieldPackagerUnpacks a field from the binary image into the given component.- Overrides:
unpackin classISOBinaryFieldPackager- Parameters:
c- - the Component to unpackb- - binary imageoffset- - starting offset within the binary image- Returns:
- consumed bytes
- Throws:
ISOException- on ISO processing error
-
unpack
Description copied from class:ISOBinaryFieldPackagerUnpack from an input stream- Overrides:
unpackin classISOBinaryFieldPackager- Parameters:
c- - the Component to unpackin- - input stream- Throws:
IOException- on I/O failureISOException- on unpacking error
-
getMaxPackedLength
Description copied from class:ISOFieldPackagerReturns the maximum number of bytes this packager can produce.- Overrides:
getMaxPackedLengthin classISOBinaryFieldPackager- Returns:
- maximum packed length in bytes
-