import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
ParserState state = ParserState.EXPECTING_ACCOUNT;
String line;
- BufferedReader buf =
- new BufferedReader(new InputStreamReader(resp, "UTF-8"));
+ BufferedReader buf = new BufferedReader(
+ new InputStreamReader(resp, StandardCharsets.UTF_8));
int processedTransactionCount = 0;
int transactionId = 0;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
+import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Locale;
import java.util.Map;
try (OutputStream req = http.getOutputStream()) {
Log.d("network", "Request body: " + body);
- req.write(body.getBytes("ASCII"));
+ req.write(body.getBytes(StandardCharsets.US_ASCII));
try (InputStream resp = http.getInputStream()) {
Log.d("update_accounts", String.valueOf(http.getResponseCode()));
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
+import java.nio.charset.StandardCharsets;
public final class NetworkUtil {
private static final int thirtySeconds = 30000;
if (use_auth) {
final String auth_user = profile.getAuthUserName();
final String auth_password = profile.getAuthPassword();
- final byte[] bytes =
- (String.format("%s:%s", auth_user, auth_password)).getBytes("UTF-8");
+ final byte[] bytes = (String.format("%s:%s", auth_user, auth_password))
+ .getBytes(StandardCharsets.UTF_8);
final String value = Base64.encodeToString(bytes, Base64.DEFAULT);
http.setRequestProperty("Authorization", "Basic " + value);
}