Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/main/java/org/apache/commons/codec/binary/Hex.java
- ===================================================================
- --- src/main/java/org/apache/commons/codec/binary/Hex.java (revision 1464242)
- +++ src/main/java/org/apache/commons/codec/binary/Hex.java (working copy)
- @@ -26,6 +26,8 @@
- import org.apache.commons.codec.DecoderException;
- import org.apache.commons.codec.EncoderException;
- +import org.apache.commons.codec.LetterCase;
- +
- /**
- * Converts hexadecimal Strings. The charset used for certain operation can be set, the default is set in
- * {@link #DEFAULT_CHARSET_NAME}
- @@ -132,6 +134,22 @@
- *
- * @param data
- * a byte[] to convert to Hex characters
- + * @param letterCase
- + * the lettercase to use for ouput
- + * @return A char[] containing hexadecimal characters
- + * @since 1.8
- + */
- + public static char[] encodeHex(final byte[] data, final LetterCase letterCase) {
- + return encodeHex(data, LetterCase.LOWER == letterCase ? DIGITS_LOWER : DIGITS_UPPER);
- + }
- +
- + /**
- + * Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
- + * The returned array will be double the length of the passed array, as it takes two characters to represent any
- + * given byte.
- + *
- + * @param data
- + * a byte[] to convert to Hex characters
- * @param toDigits
- * the output alphabet
- * @return A char[] containing hexadecimal characters
- Index: src/main/java/org/apache/commons/codec/LetterCase.java
- ===================================================================
- --- src/main/java/org/apache/commons/codec/LetterCase.java (revision 0)
- +++ src/main/java/org/apache/commons/codec/LetterCase.java (working copy)
- @@ -0,0 +1,19 @@
- +package org.apache.commons.codec;
- +
- +/**
- + * Enumerates letter cases, upper and lower.
- + *
- + * @since 1.8
- + */
- +public enum LetterCase {
- +
- + /**
- + * Upper case.
- + */
- + UPPER,
- +
- + /**
- + * Lower case.
- + */
- + LOWER
- +}
- Index: src/main/java/org/apache/commons/codec/LetterCase.java
- ===================================================================
- --- src/main/java/org/apache/commons/codec/LetterCase.java (revision 0)
- +++ src/main/java/org/apache/commons/codec/LetterCase.java (working copy)
- Property changes on: src/main/java/org/apache/commons/codec/LetterCase.java
- ___________________________________________________________________
- Added: svn:keywords
- ## -0,0 +1 ##
- +Id
- \ No newline at end of property
- Added: svn:eol-style
- ## -0,0 +1 ##
- +native
- \ No newline at end of property
Advertisement
Add Comment
Please, Sign In to add comment