webfunds.sox
Class ArmouredPayment
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.ArmouredPayment
- public class ArmouredPayment
- extends Encodable
I think the pattern is probably wrong here, but I need
to move the armouring of the payment closer to the action
(and the higher level application code doesn't so much care.)
At a later time, it might be nice to set some paramaters
as to how to produce the payments and decode them.
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
ORIGINAL_VERSION
public static final java.lang.String ORIGINAL_VERSION
CURRENT_VERSION
public static final java.lang.String CURRENT_VERSION
SOX_MESSAGE
public static final java.lang.String SOX_MESSAGE
ArmouredPayment
public ArmouredPayment(AbstractPayment pay)
ArmouredPayment
public ArmouredPayment(byte[] data)
throws SOXPacketException
- Make a decoder from a byte array.
- Parameters:
SOXPacketException - the data was bad
ArmouredPayment
public ArmouredPayment(java.io.InputStream is)
throws SOXPacketException
- Recover an ArmouredPayment from an input stream.
- Parameters:
SOXPacketException - the data was bad
getPay
public AbstractPayment getPay()
getDecodeErrors
public java.lang.String getDecodeErrors()
encode
public void encode(java.io.OutputStream os)
throws java.io.IOException
- Make an ASCII-armoured message from a payment, a la PGP armouring.
- Overrides:
- encode in class Encodable
- Throws:
- java.lang.IllegalArgumentException - if no AbstractPayment available
decode
public void decode(java.io.InputStream is)
throws SOXPacketException,
java.io.IOException
- Decoder of SOX armoured messages.
XXX: This is back to front, overrides normal Encodable method
as de-armouring is done on byte arrays not streams.
- Overrides:
- decode in class Encodable
- Throws:
- SOXPacketException - if the payment failed to recover,
decode
public void decode(byte[] data)
throws SOXPacketException
- Decoder of SOX armoured messages.
XXX: This is back to front, overrides normal Encodable method
as de-armouring is done on byte arrays not streams.
- Overrides:
- decode in class Encodable
- Throws:
- SOXPacketException - if the payment failed to recover,
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
- equals in class java.lang.Object
example
public static ArmouredPayment example()
main
public static void main(java.lang.String[] args)
cycle
protected static void cycle()
throws java.lang.Exception
output
protected static void output()
throws java.lang.Exception
readWrite
protected static void readWrite()
throws java.lang.Exception
input
protected static void input()
throws java.lang.Exception