Faster and cleaner way to obtain UTF-8 encoded form.

Instead of specifying character encoding by name, the faster, cleaner,
and safer way is to use StandardCharsets.UTF_8.

Bug: 27461702
Change-Id: I897284d3ceeb44a21cc74de09a9b25f6aec8c205
This commit is contained in:
Alex Klyubin
2016-06-14 14:18:21 -07:00
parent cf89865b95
commit d4761a19b8
5 changed files with 10 additions and 15 deletions

View File

@@ -57,6 +57,7 @@ import java.io.OutputStream;
import java.lang.reflect.Constructor;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.security.Key;
import java.security.KeyFactory;
@@ -717,7 +718,7 @@ class SignApk {
// archive comment, so that tools that display the comment
// (hopefully) show something sensible.
// TODO: anything more useful we can put in this message?
byte[] message = "signed by SignApk".getBytes("UTF-8");
byte[] message = "signed by SignApk".getBytes(StandardCharsets.UTF_8);
temp.write(message);
temp.write(0);