Examples of Hex


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

    try {
      digest = MessageDigest.getInstance(digestAlgorithm);
    } catch (NoSuchAlgorithmException e) {
      throw new RuntimeException(e);
    }
    id = new Hex().encode(digest.digest(pubKey.getEncoded()));
  }
View Full Code Here

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

                    //Duplicate so we don't destroy original data :)
                    ByteBuffer hexBuffer = chunk.getData().duplicate();

                    ByteBuffer charBuffer = hexBuffer.duplicate();

                    Hex hexencoder = new Hex();

                    while (hexBuffer.hasRemaining())
                    {
                        byte[] line = new byte[LINE_SIZE];

                        int bufsize = hexBuffer.remaining();
                        if (bufsize < LINE_SIZE)
                        {
                            hexBuffer.get(line, 0, bufsize);
                        }
                        else
                        {
                            bufsize = line.length;
                            hexBuffer.get(line);
                        }

                        byte[] encoded = hexencoder.encode(line);

                        try
                        {
                            String encStr = new String(encoded, 0, bufsize * 2, DEFAULT_ENCODING);
                            String hexLine = "";
View Full Code Here

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

      long compactID = Long.parseLong(tokens[0]);
     
      CompactionIterators iters = new CompactionIterators();

      if (tokens.length > 1) {
        Hex hex = new Hex();
        ByteArrayInputStream bais = new ByteArrayInputStream(hex.decode(tokens[1].split("=")[1].getBytes(Constants.UTF8)));
        DataInputStream dis = new DataInputStream(bais);
       
        try {
          iters.readFields(dis);
        } catch (IOException e) {
View Full Code Here

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

                    //Duplicate so we don't destroy original data :)
                    java.nio.ByteBuffer hexBuffer = buf;

                    java.nio.ByteBuffer charBuffer = hexBuffer.duplicate();

                    Hex hexencoder = new Hex();

                    while (hexBuffer.hasRemaining())
                    {
                        byte[] line = new byte[LINE_SIZE];

                        int bufsize = hexBuffer.remaining();
                        if (bufsize < LINE_SIZE)
                        {
                            hexBuffer.get(line, 0, bufsize);
                        }
                        else
                        {
                            bufsize = line.length;
                            hexBuffer.get(line);
                        }

                        byte[] encoded = hexencoder.encode(line);

                        try
                        {
                            String encStr = new String(encoded, 0, bufsize * 2, DEFAULT_ENCODING);
                            String hexLine = "";
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

                    //Duplicate so we don't destroy original data :)
                    ByteBuffer hexBuffer = chunk.getData().duplicate();

                    ByteBuffer charBuffer = hexBuffer.duplicate();

                    Hex hexencoder = new Hex();

                    while (hexBuffer.hasRemaining())
                    {
                        byte[] line = new byte[LINE_SIZE];

                        int bufsize = hexBuffer.remaining();
                        if (bufsize < LINE_SIZE)
                        {
                            hexBuffer.get(line, 0, bufsize);
                        }
                        else
                        {
                            bufsize = line.length;
                            hexBuffer.get(line);
                        }

                        byte[] encoded = hexencoder.encode(line);

                        try
                        {
                            String encStr = new String(encoded, 0, bufsize * 2, DEFAULT_ENCODING);
                            String hexLine = "";
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

                    //Duplicate so we don't destroy original data :)
                    java.nio.ByteBuffer hexBuffer = buf;

                    java.nio.ByteBuffer charBuffer = hexBuffer.duplicate();

                    Hex hexencoder = new Hex();

                    while (hexBuffer.hasRemaining())
                    {
                        byte[] line = new byte[LINE_SIZE];

                        int bufsize = hexBuffer.remaining();
                        if (bufsize < LINE_SIZE)
                        {
                            hexBuffer.get(line, 0, bufsize);
                        }
                        else
                        {
                            bufsize = line.length;
                            hexBuffer.get(line);
                        }

                        byte[] encoded = hexencoder.encode(line);

                        try
                        {
                            String encStr = new String(encoded, 0, bufsize * 2, DEFAULT_ENCODING);
                            String hexLine = "";
View Full Code Here

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

                    //Duplicate so we don't destroy original data :)
                    ByteBuffer hexBuffer = chunk.getData().duplicate();

                    ByteBuffer charBuffer = hexBuffer.duplicate();

                    Hex hexencoder = new Hex();

                    while (hexBuffer.hasRemaining())
                    {
                        byte[] line = new byte[LINE_SIZE];

                        int bufsize = hexBuffer.remaining();
                        if (bufsize < LINE_SIZE)
                        {
                            hexBuffer.get(line, 0, bufsize);
                        }
                        else
                        {
                            bufsize = line.length;
                            hexBuffer.get(line);
                        }

                        byte[] encoded = hexencoder.encode(line);

                        try
                        {
                            String encStr = new String(encoded, 0, bufsize * 2, DEFAULT_ENCODING);
                            String hexLine = "";
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.