Class IFTA_LLLCHAR
java.lang.Object
org.jpos.iso.ISOFieldPackager
org.jpos.iso.ISOStringFieldPackager
org.jpos.iso.IFA_LLLCHAR
org.jpos.tlv.packager.IFTA_LLLCHAR
- All Implemented Interfaces:
TaggedFieldPackager
ISOFieldPackager for a 3-digit ASCII-length-prefixed character tagged field.
-
Field Summary
Fields inherited from class ISOFieldPackager
pad, trim -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.IFTA_LLLCHAR(int len, String description) Constructs a packager with the given length and description. -
Method Summary
Modifier and TypeMethodDescriptioncreateComponent(int fieldNumber) Creates anISOComponentinstance appropriate for this packager.protected ISOFieldPackagerReturns the packager used to pack/unpack the tag field.getToken()Returns the tag token for this packager.byte[]pack(ISOComponent c) Convert the component into a byte[].voidpack(ISOComponent c, ObjectOutput out) Packs the component to an ObjectOutput stream.protected byte[]Packs the tag portion of the tagged field.voidSets the tag token for this packager.intunpack(ISOComponent c, byte[] b, int offset) Unpacks the byte array into the component.voidunpack(ISOComponent c, InputStream in) Unpack the input stream into the component.protected intunpackTag(ISOComponent c, byte[] tagBytes, int offset) Unpacks the tag from a byte array.protected voidunpackTag(ISOComponent c, InputStream in) Unpacks the tag from an InputStream.Methods inherited from class IFA_LLLCHAR
setLengthMethods inherited from class ISOStringFieldPackager
checkLength, getMaxPackedLength, setInterpreter, setPadder, setPrefixer, setTrimModifier and TypeMethodDescriptionprotected voidcheckLength(int len, int maxLength) Checks the length of the data against the maximum, and throws an IllegalArgumentException.intReturns the prefixer's packed length and the interpreter's packed length.voidsetInterpreter(Interpreter interpreter) Sets the Interpreter.voidSets the Padder.voidsetPrefixer(Prefixer prefixer) Sets the length prefixer.voidsetTrim(boolean trim) Enables or disables trimming for this field.Methods inherited from class ISOFieldPackager
getDescription, getLength, readBytes, setDescription, setPadModifier and TypeMethodDescriptionReturns the field description.intReturns the maximum field length.protected byte[]readBytes(InputStream in, int l) Reads exactlylbytes from the input stream.voidsetDescription(String description) Sets the field description.voidsetPad(boolean pad) Enables or disables padding for this field.
-
Constructor Details
-
IFTA_LLLCHAR
public IFTA_LLLCHAR()Default constructor. -
IFTA_LLLCHAR
Constructs a packager with the given length and description.- Parameters:
len- field lengthdescription- field description
-
-
Method Details
-
createComponent
Description copied from class:ISOFieldPackagerCreates anISOComponentinstance appropriate for this packager.- Overrides:
createComponentin classISOFieldPackager- Parameters:
fieldNumber- the field number to assign to the new component- Returns:
- a new ISOComponent
-
setToken
Description copied from interface:TaggedFieldPackagerSets the tag token for this packager.- Specified by:
setTokenin interfaceTaggedFieldPackager- Parameters:
token- the tag token
-
getToken
Description copied from interface:TaggedFieldPackagerReturns the tag token for this packager.- Specified by:
getTokenin interfaceTaggedFieldPackager- Returns:
- the tag token
-
getTagPackager
Returns the packager used to pack/unpack the tag field.- Returns:
- the tag packager
-
packTag
Packs the tag portion of the tagged field.- Parameters:
c- the ISO component- Returns:
- packed tag bytes
- Throws:
ISOException- on pack error
-
unpackTag
Unpacks the tag from a byte array.- Parameters:
c- the ISO componenttagBytes- byte array containing tag dataoffset- starting offset- Returns:
- number of bytes consumed
- Throws:
ISOException- on unpack error
-
unpackTag
Unpacks the tag from an InputStream.- Parameters:
c- the ISO componentin- the input stream- Throws:
ISOException- on unpack errorIOException- on I/O error
-
pack
Description copied from class:ISOStringFieldPackagerConvert the component into a byte[].- Overrides:
packin classISOStringFieldPackager- Parameters:
c- - a component- Returns:
- byte array representation of component
- Throws:
ISOException- on pack/unpack error
-
unpack
Description copied from class:ISOStringFieldPackagerUnpacks the byte array into the component.- Overrides:
unpackin classISOStringFieldPackager- Parameters:
c- The component to unpack into.b- The byte array to unpack.offset- The index in the byte array to start unpacking from.- Returns:
- The number of bytes consumed unpacking the component.
- Throws:
ISOException- on unpacking error
-
unpack
Description copied from class:ISOStringFieldPackagerUnpack the input stream into the component.- Overrides:
unpackin classISOStringFieldPackager- Parameters:
c- The Component to unpack into.in- Input stream where the packed bytes come from.- Throws:
IOException- Thrown if there's a problem reading the input stream.ISOException- on unpacking error
-
pack
Description copied from class:ISOFieldPackagerPacks the component to an ObjectOutput stream.- Overrides:
packin classISOFieldPackager- Parameters:
c- - the Component to packout- - output stream- Throws:
IOException- on I/O failureISOException- on packing error
-