Examples of Hex


Examples of org.apache.axis.encoding.Hex

                }
            }
        }

        {
            Hex input = new Hex("3344");
            try {
                output = binding.echoHexBinary(input.getBytes());
                verify("echoHexBinary", input, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoHexBinary", input, e);
                } else {
                    throw e;
                }
            }
        }
        Calendar inputDate = Calendar.getInstance();
        inputDate.setTimeZone(TimeZone.getTimeZone("GMT"));
        inputDate.setTime(new Date());
        {
            try {
                output = binding.echoDate(inputDate);
                verify("echoDate", inputDate, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoDate", inputDate, e);
                } else {
                    throw e;
                }
            }
        }

        {
            BigDecimal input = new BigDecimal("3.14159");
            try {
                output = binding.echoDecimal(input);
                verify("echoDecimal", input, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoDecimal", input, e);
                } else {
                    throw e;
                }
            }
        }

        {
            Boolean input = Boolean.TRUE;
            try {
                output = new Boolean( binding.echoBoolean(input.booleanValue()));
                verify("echoBoolean", input, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoBoolean", input, e);
                } else {
View Full Code Here

Examples of org.apache.axis.encoding.Hex

                    new byte[0]);
    }

    public void testHex() throws Exception {
        deserialize("<result xsi:type=\"xsd:hexBinary\">50A9</result>",
                    new Hex("50A9"),true);
    }
View Full Code Here

Examples of org.apache.axis.encoding.Hex

                    new Hex("50A9"),true);
    }

    public void testHexNull() throws Exception {
        deserialize("<result xsi:type=\"xsd:hexBinary\"></result>",
                    new Hex(""),true);
    }
View Full Code Here

Examples of org.apache.axis.encoding.Hex

                }
            }
        }

        {
            Hex input = new Hex("3344");
            try {
                output = binding.echoHexBinary(input.getBytes());
                verify("echoHexBinary", input, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoHexBinary", input, e);
                } else {
                    throw e;
                }
            }
        }
        Calendar inputDate = Calendar.getInstance();
        inputDate.setTimeZone(TimeZone.getTimeZone("GMT"));
        inputDate.setTime(new Date());
        {
            try {
                output = binding.echoDate(inputDate);
                verify("echoDate", inputDate, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoDate", inputDate, e);
                } else {
                    throw e;
                }
            }
        }

        {
            BigDecimal input = new BigDecimal("3.14159");
            try {
                output = binding.echoDecimal(input);
                verify("echoDecimal", input, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoDecimal", input, e);
                } else {
                    throw e;
                }
            }
        }

        {
            Boolean input = Boolean.TRUE;
            try {
                output = new Boolean( binding.echoBoolean(input.booleanValue()));
                verify("echoBoolean", input, output);
            } catch (Exception e) {
                if (!testMode) {
                    verify("echoBoolean", input, e);
                } else {
View Full Code Here

Examples of org.apache.axis.encoding.Hex

    {
        if (buf != null) {
            if (javaType == byte[].class) {
                value = Hex.decode(buf.toString());
            } else {
                value = new Hex(buf.toString());
            }
        }
        super.onEndElement(namespace,localName, context);
        if (value == null) value = new Hex("");
    }
View Full Code Here

Examples of org.apache.axis.encoding.Hex

        if (arg instanceof Hex &&
            destClass == byte[].class) {
            return ((Hex) arg).getBytes();
        } else if (arg instanceof byte[] &&
                   destClass == Hex.class) {
            return new Hex((byte[]) arg);
        }

        // Convert between Calendar and Date
        if (arg instanceof Calendar && destClass == Date.class) {
            return ((Calendar) arg).getTime();
View Full Code Here

Examples of org.apache.commons.codec.binary.Hex

            // Compute the hmac on input data bytes
            byte[] rawHmac = mac.doFinal(message.getBytes(UTF_8));

            // Convert raw bytes to Hex
            byte[] hexBytes = new Hex().encode(rawHmac);

            // Covert array of Hex bytes to a String
            return new String(hexBytes, UTF_8);
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
View Full Code Here

Examples of org.apache.commons.codec.binary.Hex

     * @return an instance of {@link ResourceChecksumSourceImpl} that uses MD5 and Hex encoding.
     * @since 3.0.3
     */
    protected ResourceChecksumSource createResourceChecksumSource()
    {
        return new ResourceChecksumSourceImpl("MD5", new Hex());
    }
View Full Code Here

Examples of org.apache.commons.codec.binary.Hex

     * @return
     */
    private static String displayByteFormat(Composite localComposite, byte[] byteArray, int numOfBytes,
                                            String encoding, String direction, boolean isHex)
    {
        final Hex hexeconder = new Hex();
        final byte[] encoded = hexeconder.encode(byteArray);

        int hexLength = byteArray.length * 2;
        StringBuilder sb = new StringBuilder();
        int currentBytePos = (Integer) localComposite.getData("currentBytePos");
        int startingBytePos = (Integer) localComposite.getData("startingBytePos");
View Full Code Here

Examples of org.apache.commons.codec.binary.Hex

* @author Joel Uckelman
*/
public class KeyUtilsTest {
@Test
  public void makeOutKeyMD5() throws Exception {
    final Hex hex = new Hex();
    final byte[] hash =
      hex.decode("8a9111fe05f9815fc55c728137c5b389".getBytes());
    final byte type = 0;
    final byte[] col = "vassalengine.org/VASSAL 3.1.15".getBytes();

    // It's neat that I have to cast one-byte numeric literals to bytes.
    // Thanks, Java!
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.