Package org.apache.commons.codec.binary

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


          }

          StringBuilder encodedIterators = new StringBuilder();

          if (iterators != null) {
            Hex hex = new Hex();
            encodedIterators.append(",");
            encodedIterators.append(txidString);
            encodedIterators.append("=");
            encodedIterators.append(new String(hex.encode(iterators)));
          }
         
          return ("" + flushID + encodedIterators).getBytes();
        }
      });
View Full Code Here


      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()));
        DataInputStream dis = new DataInputStream(bais);
       
        try {
          iters.readFields(dis);
        } catch (IOException e) {
View Full Code Here

      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

     * @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

     * @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

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

                    //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

      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

                    //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

     * @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

TOP

Related Classes of org.apache.commons.codec.binary.Hex

Copyright © 2018 www.massapicom. 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.