|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpos.iso.ISOFieldPackager
org.jpos.iso.ISOBinaryFieldPackager
public class ISOBinaryFieldPackager
| Field Summary |
|---|
| Fields inherited from class org.jpos.iso.ISOFieldPackager |
|---|
pad |
| Constructor Summary | |
|---|---|
ISOBinaryFieldPackager()
Constructs a default ISOBinaryFieldPackager. |
|
ISOBinaryFieldPackager(BinaryInterpreter interpreter,
Prefixer prefixer)
Creates an ISOBinaryFieldPackager. |
|
ISOBinaryFieldPackager(int maxLength,
String description,
BinaryInterpreter interpreter,
Prefixer prefixer)
Creates an ISOBinaryFieldPackager. |
|
| Method Summary | |
|---|---|
protected void |
checkLength(int len,
int maxLength)
Checks the length of the data against the maximum, and throws an IllegalArgumentException. |
ISOComponent |
createComponent(int fieldNumber)
component factory |
int |
getMaxPackedLength()
|
byte[] |
pack(ISOComponent c)
Convert the component into a byte[]. |
void |
setInterpreter(BinaryInterpreter interpreter)
Sets the Interpreter. |
void |
setPrefixer(Prefixer prefixer)
Sets the length prefixer. |
int |
unpack(ISOComponent c,
byte[] b,
int offset)
|
void |
unpack(ISOComponent c,
InputStream in)
Unpack from an input stream |
| Methods inherited from class org.jpos.iso.ISOFieldPackager |
|---|
getDescription, getLength, pack, readBytes, setDescription, setLength, setPad |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ISOBinaryFieldPackager()
public ISOBinaryFieldPackager(int maxLength,
String description,
BinaryInterpreter interpreter,
Prefixer prefixer)
maxLength - The maximum length of the field in characters or bytes depending on the datatype.description - The description of the field. For human readable output.interpreter - The interpreter used to encode the field.prefixer - The type of length prefixer used to encode this field.
public ISOBinaryFieldPackager(BinaryInterpreter interpreter,
Prefixer prefixer)
interpreter - The interpreter used to encode the field.prefixer - The type of length prefixer used to encode this field.| Method Detail |
|---|
public void setInterpreter(BinaryInterpreter interpreter)
interpreter - The interpreter to use in packing and unpacking.public void setPrefixer(Prefixer prefixer)
prefixer - The length prefixer to use during packing and unpacking.public int getMaxPackedLength()
getMaxPackedLength in class ISOFieldPackagerISOFieldPackager.getMaxPackedLength()
public byte[] pack(ISOComponent c)
throws ISOException
pack in class ISOFieldPackagerc - - a component
ISOException
public int unpack(ISOComponent c,
byte[] b,
int offset)
throws ISOException
unpack in class ISOFieldPackagerc - - the Component to unpackb - - binary imageoffset - - starting offset within the binary image
ISOExceptionISOFieldPackager.unpack(org.jpos.iso.ISOComponent,
byte[], int)
public void unpack(ISOComponent c,
InputStream in)
throws IOException,
ISOException
unpack in class ISOFieldPackagerc - - the Component to unpackin - - input stream
ISOException
IOExceptionpublic ISOComponent createComponent(int fieldNumber)
createComponent in class ISOFieldPackagerfieldNumber - - the field number
protected void checkLength(int len,
int maxLength)
throws IllegalArgumentException
len - The length of the data for this field packager.maxLength - The maximum length allowed for this type of field packager.
This depends on the prefixer that is used.
IllegalArgumentException - If len > maxLength.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||