Class DatasetFieldPackager
java.lang.Object
org.jpos.iso.ISOFieldPackager
org.jpos.iso.DatasetFieldPackager
Wraps a regular binary field packager so its payload can be exposed as an
ISODatasetField.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ISODatasetPackagerInner packager that handles the dataset payload (TLV/DBM).protected ISOFieldPackagerOuter field packager handling length and transport encoding.Fields inherited from class ISOFieldPackager
pad, trim -
Constructor Summary
ConstructorsConstructorDescriptionDatasetFieldPackager(ISOFieldPackager fieldPackager, ISODatasetPackager datasetPackager) Creates a dataset-aware field packager. -
Method Summary
Modifier and TypeMethodDescriptioncreateComponent(int fieldNumber) Creates anISODatasetFieldfor the supplied field number.Returns the inner dataset payload packager.Returns the wrapped outer field packager.intReturns the maximum packed length of the outer field.byte[]pack(ISOComponent c) Packs a dataset field by first encoding the inner dataset payload and then delegating the outer field framing to the wrapped field packager.intunpack(ISOComponent c, byte[] b, int offset) Unpacks a dataset field from a byte array.voidunpack(ISOComponent c, InputStream in) Unpacks a dataset field from a stream.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.
-
Field Details
-
datasetPackager
Inner packager that handles the dataset payload (TLV/DBM). -
fieldPackager
Outer field packager handling length and transport encoding.
-
-
Constructor Details
-
DatasetFieldPackager
Creates a dataset-aware field packager.- Parameters:
fieldPackager- outer field packager used for length and transport encodingdatasetPackager- inner dataset payload packager
-
-
Method Details
-
pack
Packs a dataset field by first encoding the inner dataset payload and then delegating the outer field framing to the wrapped field packager.- Specified by:
packin classISOFieldPackager- Parameters:
c- field component to pack- Returns:
- packed field bytes
- Throws:
ISOException- on packing errors
-
unpack
Unpacks a dataset field from a byte array.- Specified by:
unpackin classISOFieldPackager- Parameters:
c- destination componentb- source bufferoffset- starting offset- Returns:
- number of bytes consumed from the outer field
- Throws:
ISOException- on unpacking errors
-
unpack
Unpacks a dataset field from a stream.- Overrides:
unpackin classISOFieldPackager- Parameters:
c- destination componentin- source stream- Throws:
IOException- on stream errorsISOException- on unpacking errors
-
createComponent
Creates anISODatasetFieldfor the supplied field number.- Overrides:
createComponentin classISOFieldPackager- Parameters:
fieldNumber- outer field number- Returns:
- dataset field component
-
getMaxPackedLength
Returns the maximum packed length of the outer field.- Specified by:
getMaxPackedLengthin classISOFieldPackager- Returns:
- maximum packed length
-
getISODatasetPackager
Returns the inner dataset payload packager.- Returns:
- dataset packager
-
getISOFieldPackager
Returns the wrapped outer field packager.- Returns:
- outer field packager
-