Class IF_FSTBINARY
java.lang.Object
org.jpos.iso.ISOFieldPackager
org.jpos.tlv.packager.IF_FSTBINARY
- All Implemented Interfaces:
TaggedFieldPackager
Field Separator Terminated packager
-
Field Summary
Fields inherited from class ISOFieldPackager
pad, trim -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.IF_FSTBINARY(int len, String description) Constructs a packager with the given length and description. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of bytes this packager can produce.getToken()Returns the tag token for this packager.byte[]pack(ISOComponent c) Packs the given component into a byte array.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) Unpacks a field from an input stream into the given component.Methods inherited from class ISOFieldPackager
createComponent, getDescription, getLength, pack, readBytes, setDescription, setLength, setPad, setTrimModifier and TypeMethodDescriptioncreateComponent(int fieldNumber) Creates anISOComponentinstance appropriate for this packager.Returns 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
-
IF_FSTBINARY
public IF_FSTBINARY()Default constructor. -
IF_FSTBINARY
Constructs a packager with the given length and description.- Parameters:
len- - field lendescription- symbolic descrption
-
-
Method Details
-
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
-
pack
Description copied from class:ISOFieldPackagerPacks the given component into a byte array.- Specified by:
packin classISOFieldPackager- Parameters:
c- - a component- Returns:
- packed component
- Throws:
ISOException- on pack/unpack error
-
unpack
Description copied from class:ISOFieldPackagerUnpacks a field from the binary image into the given component.- Specified by:
unpackin classISOFieldPackager- Parameters:
c- - the Component to unpackb- - binary imageoffset- - starting offset within the binary image- Returns:
- consumed bytes
- Throws:
ISOException- on pack/unpack error
-
unpack
Description copied from class:ISOFieldPackagerUnpacks a field from an input stream into the given component.- Overrides:
unpackin classISOFieldPackager- 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.- Specified by:
getMaxPackedLengthin classISOFieldPackager- Returns:
- maximum packed length in bytes
-