Class IFTB_LLBINARY
java.lang.Object
org.jpos.iso.ISOFieldPackager
org.jpos.iso.ISOBinaryFieldPackager
org.jpos.iso.IFB_LLBINARY
org.jpos.tlv.packager.IFTB_LLBINARY
- All Implemented Interfaces:
TaggedFieldPackager
ISOFieldPackager for a 2-byte binary-length-prefixed binary tagged field.
-
Field Summary
Fields inherited from class ISOFieldPackager
pad, trim -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.IFTB_LLBINARY(int len, String description) Constructs a packager with the given length and description. -
Method Summary
Modifier and TypeMethodDescriptioncreateComponent(int fieldNumber) component factoryprotected 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 a field from the binary image into the given component.voidunpack(ISOComponent c, InputStream in) Unpack from an input streamprotected 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 IFB_LLBINARY
setLengthMethods inherited from class ISOBinaryFieldPackager
checkLength, getMaxPackedLength, setInterpreter, setPrefixerModifier and TypeMethodDescriptionprotected voidcheckLength(int len, int maxLength) Checks the length of the data against the maximum, and throws an IllegalArgumentException.intReturns the maximum number of bytes this packager can produce.voidsetInterpreter(BinaryInterpreter interpreter) Sets the Interpreter.voidsetPrefixer(Prefixer prefixer) Sets the length prefixer.Methods inherited from class ISOFieldPackager
getDescription, getLength, readBytes, setDescription, setPad, setTrimModifier 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.voidsetTrim(boolean trim) Enables or disables trimming for this field.
-
Constructor Details
-
IFTB_LLBINARY
public IFTB_LLBINARY()Default constructor. -
IFTB_LLBINARY
Constructs a packager with the given length and description.- Parameters:
len- field lengthdescription- field description
-
-
Method Details
-
createComponent
Description copied from class:ISOBinaryFieldPackagercomponent factory- Overrides:
createComponentin classISOBinaryFieldPackager- Parameters:
fieldNumber- - the field number- Returns:
- the newly created component
-
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:ISOBinaryFieldPackagerConvert the component into a byte[].- Overrides:
packin classISOBinaryFieldPackager- Parameters:
c- - a component- Returns:
- packed component
- Throws:
ISOException- on packing 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 unpacking 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
-
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
-