History log of /libcore/luni/src/main/java/java/nio/charset/Charsets.java
Revision Date Author Comments
5de66adb390e0885195b4f5caa3856a790abd087 09-Aug-2012 Elliott Hughes <enh@google.com> Make Charsets final.

Change-Id: I4a16ba53eda539059738f92a07b5563370ae2693
9559e748729ef1deb6400f31d0407543cbff3566 21-Oct-2010 Elliott Hughes <enh@google.com> Improve our modified UTF-8 implementation.

I was out looking for customers for the new OSMemory peek/poke for byte[]s,
and ran into this mess. I also noticed we didn't have any real tests for
DataOutputStream. This patch rewrites DataOuputStream and ObjectOutputStream
to be simpler and cleaner, pulls modified UTF-8 encoding support out into
ModifiedUtf8 where it belongs, and adds a new special ICU-avoiding case for
String.getBytes("UTF-16BE"). And adds tests.

Bug: 3032515
Change-Id: I618c8b1bda13138feed7710e29aee0f96f2e9b95
5cd6df2f627e06f9b7f714181d70d3148a3d6c60 01-Jul-2010 Elliott Hughes <enh@google.com> Part 2 of the "new String"/String.getBytes performance work.

I didn't plan on a part 2, but my benchmark was bogus. I'd failed to take into
account the fact that the ICU code (which I was comparing against) has a higher
intercept but lower slope than the Java I replaced it with. This new code
offers the best of both worlds: low intercept (start-up cost) and low slope
(per-byte/char cost).

The bad news is that this means I'm adding more native code. In addition to the
improved benchmark, I'll commit a benchmark that contains the pure Java
implementations so we can see when the JIT advances to the point that we can
retire this native code.

Change-Id: Ibac24c2e3deed216bd492acf2fac7554d3f96d85
e810d3b49631329b11440aa5b7a54db181d42ed1 15-Jun-2010 Elliott Hughes <enh@google.com> More charset-related cleanup/optimization.

This patch adds a Charsets class that lets us avoid a hash lookup and an extra
level of method call indirection when calling String.getBytes or "new String"
for a well-known guaranteed charset. It also fixes callers to take advantage.

This also adds a special case to "new String" for the UTF-8 charset to avoid
needless duplication if we guessed the correct buffer size (which we will for
input that happens to be US-ASCII too).

The ModifiedUtf8 class gives a more meaningful name for Utils.convertUTF8WithBuf.

This also removes a dead link and un-tinyurl'ed another.

Change-Id: I02712f53dee16feb3b1db2c14536dc055126cd04