Skip to content

Commit

Permalink
Refactoring for 2.0 complete.
Browse files Browse the repository at this point in the history
Adding notIndexOf-esque methods to ArrayUtils.
  • Loading branch information
Riyad Kalla committed May 6, 2011
1 parent 29aaf3a commit 225a3e6
Show file tree
Hide file tree
Showing 10 changed files with 867 additions and 643 deletions.
12 changes: 6 additions & 6 deletions src/main/java/com/thebuzzmedia/common/charset/DecodingUtils.java
Expand Up @@ -41,21 +41,21 @@ public class DecodingUtils {
}

public static char[] decode(byte[] array) {
return (array == null ? null : decode(0, array.length, array,
UTF8_CHARSET));
return (array == null ? null : decode(array, UTF8_CHARSET, 0,
array.length));
}

public static char[] decode(byte[] array, Charset charset) {
return (array == null ? null : decode(0, array.length, array, charset));
return (array == null ? null : decode(array, charset, 0, array.length));
}

public static char[] decode(int index, int length, byte[] array) {
public static char[] decode(byte[] array, int index, int length) {
return (array == null ? null : decode(
ByteBuffer.wrap(array, index, length), UTF8_CHARSET));
}

public static char[] decode(int index, int length, byte[] array,
Charset charset) {
public static char[] decode(byte[] array, Charset charset, int index,
int length) {
return (array == null ? null : decode(
ByteBuffer.wrap(array, index, length), charset));
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/thebuzzmedia/common/charset/EncodingUtils.java
Expand Up @@ -41,21 +41,21 @@ public class EncodingUtils {
}

public static byte[] encode(char[] array) {
return (array == null ? null : encode(0, array.length, array,
UTF8_CHARSET));
return (array == null ? null : encode(array, UTF8_CHARSET, 0,
array.length));
}

public static byte[] encode(char[] array, Charset charset) {
return (array == null ? null : encode(0, array.length, array, charset));
return (array == null ? null : encode(array, charset, 0, array.length));
}

public static byte[] encode(int index, int length, char[] array) {
public static byte[] encode(char[] array, int index, int length) {
return (array == null ? null : encode(
CharBuffer.wrap(array, index, length), UTF8_CHARSET));
}

public static byte[] encode(int index, int length, char[] array,
Charset charset) {
public static byte[] encode(char[] array, Charset charset, int index,
int length) {
return (array == null ? null : encode(
CharBuffer.wrap(array, index, length), charset));
}
Expand Down

0 comments on commit 225a3e6

Please sign in to comment.