summaryrefslogtreecommitdiffstats
path: root/libart
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-04-22 14:07:02 +0100
committerNarayan Kamath <narayan@google.com>2015-04-22 13:50:01 +0000
commit3f7c674bd1d220d1a8c149b5658145171c28094f (patch)
tree1fe9d19690461a1c7d6a5fe0967f7b9fcc29da08 /libart
parent298bf64cb09d9e11f99aeda8a7a0a1f709ec91f9 (diff)
downloadlibcore-3f7c674bd1d220d1a8c149b5658145171c28094f.zip
libcore-3f7c674bd1d220d1a8c149b5658145171c28094f.tar.gz
libcore-3f7c674bd1d220d1a8c149b5658145171c28094f.tar.bz2
Move java.nio.Charsets to libcore.util.
This isn't public API, and isn't related to NIO. It's only ever used by java.lang.String. bug: 10898787 Change-Id: I4e194406746b88ba7268c2553e467e7e05400b40
Diffstat (limited to 'libart')
-rw-r--r--libart/src/main/java/java/lang/String.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/libart/src/main/java/java/lang/String.java b/libart/src/main/java/java/lang/String.java
index 0107b6e..a5bf34c 100644
--- a/libart/src/main/java/java/lang/String.java
+++ b/libart/src/main/java/java/lang/String.java
@@ -22,12 +22,12 @@ import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;
-import java.nio.charset.Charsets;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Formatter;
import java.util.Locale;
import java.util.regex.Pattern;
+import libcore.util.CharsetUtils;
import libcore.util.EmptyArray;
/**
@@ -337,12 +337,12 @@ outer:
this.offset = 0;
this.value = new char[byteCount];
this.count = byteCount;
- Charsets.isoLatin1BytesToChars(data, offset, byteCount, value);
+ CharsetUtils.isoLatin1BytesToChars(data, offset, byteCount, value);
} else if (canonicalCharsetName.equals("US-ASCII")) {
this.offset = 0;
this.value = new char[byteCount];
this.count = byteCount;
- Charsets.asciiBytesToChars(data, offset, byteCount, value);
+ CharsetUtils.asciiBytesToChars(data, offset, byteCount, value);
} else {
CharBuffer cb = charset.decode(ByteBuffer.wrap(data, offset, byteCount));
this.offset = 0;
@@ -772,13 +772,13 @@ outer:
public byte[] getBytes(Charset charset) {
String canonicalCharsetName = charset.name();
if (canonicalCharsetName.equals("UTF-8")) {
- return Charsets.toUtf8Bytes(value, offset, count);
+ return CharsetUtils.toUtf8Bytes(value, offset, count);
} else if (canonicalCharsetName.equals("ISO-8859-1")) {
- return Charsets.toIsoLatin1Bytes(value, offset, count);
+ return CharsetUtils.toIsoLatin1Bytes(value, offset, count);
} else if (canonicalCharsetName.equals("US-ASCII")) {
- return Charsets.toAsciiBytes(value, offset, count);
+ return CharsetUtils.toAsciiBytes(value, offset, count);
} else if (canonicalCharsetName.equals("UTF-16BE")) {
- return Charsets.toBigEndianUtf16Bytes(value, offset, count);
+ return CharsetUtils.toBigEndianUtf16Bytes(value, offset, count);
} else {
CharBuffer chars = CharBuffer.wrap(this.value, this.offset, this.count);
ByteBuffer buffer = charset.encode(chars.asReadOnlyBuffer());