/** * Encodes an Object using the base64 algorithm. This method is provided in order to satisfy the * requirements of the Encoder interface, and will throw an EncoderException if the supplied * object is not of type byte[]. * * @param pObject * Object to encode * @return An object (of type byte[]) containing the base64 encoded data which corresponds to * the byte[] supplied. * @throws IllegalArgumentException * if the parameter supplied is not of type byte[] */ public Object encode(Object pObject) { if (!(pObject instanceof byte[])) { throw new IllegalArgumentException( "Parameter supplied to Base64 encode is not a byte[]"); } return encode((byte[])pObject); }
/** * Encodes an Object using the base64 algorithm. This method is provided in order to satisfy the * requirements of the Encoder interface, and will throw an EncoderException if the supplied * object is not of type byte[]. * * @param pObject * Object to encode * @return An object (of type byte[]) containing the base64 encoded data which corresponds to * the byte[] supplied. * @throws IllegalArgumentException * if the parameter supplied is not of type byte[] */ public Object encode(Object pObject) { if (!(pObject instanceof byte[])) { throw new IllegalArgumentException( "Parameter supplied to Base64 encode is not a byte[]"); } return encode((byte[])pObject); }