mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 18:25:51 +00:00
Migrate from Guava Charsets to Java7 StandardCharsets constants.
This commit is contained in:
parent
faf58ac9a2
commit
5b008f90e0
@ -20,12 +20,11 @@ package org.bitcoinj.core;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.BufferUnderflowException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -366,7 +365,7 @@ public class BitcoinSerializer extends MessageSerializer {
|
||||
for (; header[cursor] != 0 && cursor < COMMAND_LEN; cursor++) ;
|
||||
byte[] commandBytes = new byte[cursor];
|
||||
System.arraycopy(header, 0, commandBytes, 0, cursor);
|
||||
command = new String(commandBytes, Charsets.US_ASCII);
|
||||
command = new String(commandBytes, StandardCharsets.US_ASCII);
|
||||
cursor = COMMAND_LEN;
|
||||
|
||||
size = (int) readUint32(header, cursor);
|
||||
|
@ -19,7 +19,6 @@ package org.bitcoinj.core;
|
||||
import org.bitcoinj.store.BlockStore;
|
||||
import org.bitcoinj.store.BlockStoreException;
|
||||
import org.bitcoinj.store.FullPrunedBlockStore;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.hash.HashCode;
|
||||
import com.google.common.hash.Hasher;
|
||||
import com.google.common.hash.Hashing;
|
||||
@ -37,6 +36,7 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Arrays;
|
||||
@ -155,7 +155,7 @@ public class CheckpointManager {
|
||||
Hasher hasher = Hashing.sha256().newHasher();
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
reader = new BufferedReader(new InputStreamReader(inputStream, Charsets.US_ASCII));
|
||||
reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.US_ASCII));
|
||||
String magic = reader.readLine();
|
||||
if (!TEXTUAL_MAGIC.equals(magic))
|
||||
throw new IOException("unexpected magic: " + magic);
|
||||
|
@ -20,7 +20,6 @@ package org.bitcoinj.core;
|
||||
|
||||
import org.bitcoinj.crypto.*;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Preconditions;
|
||||
@ -54,6 +53,7 @@ import javax.annotation.Nullable;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.SignatureException;
|
||||
import java.util.Arrays;
|
||||
@ -881,7 +881,7 @@ public class ECKey implements EncryptableItem {
|
||||
sigData[0] = (byte)headerByte;
|
||||
System.arraycopy(Utils.bigIntegerToBytes(sig.r, 32), 0, sigData, 1, 32);
|
||||
System.arraycopy(Utils.bigIntegerToBytes(sig.s, 32), 0, sigData, 33, 32);
|
||||
return new String(Base64.encode(sigData), Charsets.UTF_8);
|
||||
return new String(Base64.encode(sigData), StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1290,7 +1290,7 @@ public class ECKey implements EncryptableItem {
|
||||
|
||||
/** The string that prefixes all text messages signed using Bitcoin keys. */
|
||||
private static final String BITCOIN_SIGNED_MESSAGE_HEADER = "Bitcoin Signed Message:\n";
|
||||
private static final byte[] BITCOIN_SIGNED_MESSAGE_HEADER_BYTES = BITCOIN_SIGNED_MESSAGE_HEADER.getBytes(Charsets.UTF_8);
|
||||
private static final byte[] BITCOIN_SIGNED_MESSAGE_HEADER_BYTES = BITCOIN_SIGNED_MESSAGE_HEADER.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
/**
|
||||
* <p>Given a textual message, returns a byte buffer formatted as follows:</p>
|
||||
@ -1301,7 +1301,7 @@ public class ECKey implements EncryptableItem {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
bos.write(BITCOIN_SIGNED_MESSAGE_HEADER_BYTES.length);
|
||||
bos.write(BITCOIN_SIGNED_MESSAGE_HEADER_BYTES);
|
||||
byte[] messageBytes = message.getBytes(Charsets.UTF_8);
|
||||
byte[] messageBytes = message.getBytes(StandardCharsets.UTF_8);
|
||||
VarInt size = new VarInt(messageBytes.length);
|
||||
bos.write(size.encode());
|
||||
bos.write(messageBytes);
|
||||
|
@ -20,10 +20,9 @@ package org.bitcoinj.core;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import java.io.*;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
@ -349,7 +348,7 @@ public abstract class Message {
|
||||
|
||||
protected String readStr() throws ProtocolException {
|
||||
long length = readVarInt();
|
||||
return length == 0 ? "" : new String(readBytes((int) length), Charsets.UTF_8); // optimization for empty strings
|
||||
return length == 0 ? "" : new String(readBytes((int) length), StandardCharsets.UTF_8); // optimization for empty strings
|
||||
}
|
||||
|
||||
protected Sha256Hash readHash() throws ProtocolException {
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Objects;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@ -98,11 +98,11 @@ public class RejectMessage extends Message {
|
||||
|
||||
@Override
|
||||
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
|
||||
byte[] messageBytes = message.getBytes(Charsets.UTF_8);
|
||||
byte[] messageBytes = message.getBytes(StandardCharsets.UTF_8);
|
||||
stream.write(new VarInt(messageBytes.length).encode());
|
||||
stream.write(messageBytes);
|
||||
stream.write(code.code);
|
||||
byte[] reasonBytes = reason.getBytes(Charsets.UTF_8);
|
||||
byte[] reasonBytes = reason.getBytes(StandardCharsets.UTF_8);
|
||||
stream.write(new VarInt(reasonBytes.length).encode());
|
||||
stream.write(reasonBytes);
|
||||
if ("block".equals(message) || "tx".equals(message))
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.net.InetAddresses;
|
||||
|
||||
@ -26,6 +25,7 @@ import java.io.OutputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
@ -175,7 +175,7 @@ public class VersionMessage extends Message {
|
||||
Utils.uint32ToByteStreamLE(0, buf);
|
||||
Utils.uint32ToByteStreamLE(0, buf);
|
||||
// Now comes subVer.
|
||||
byte[] subVerBytes = subVer.getBytes(Charsets.UTF_8);
|
||||
byte[] subVerBytes = subVer.getBytes(StandardCharsets.UTF_8);
|
||||
buf.write(new VarInt(subVerBytes.length).encode());
|
||||
buf.write(subVerBytes);
|
||||
// Size of known block chain.
|
||||
|
@ -17,7 +17,6 @@
|
||||
package org.bitcoinj.crypto;
|
||||
|
||||
import org.bitcoinj.core.*;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.primitives.Bytes;
|
||||
import com.lambdaworks.crypto.SCrypt;
|
||||
|
||||
@ -25,6 +24,7 @@ import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.text.Normalizer;
|
||||
import java.util.Arrays;
|
||||
@ -117,7 +117,7 @@ public class BIP38PrivateKey extends PrefixedChecksummedBytes {
|
||||
public ECKey decrypt(String passphrase) throws BadPassphraseException {
|
||||
String normalizedPassphrase = Normalizer.normalize(passphrase, Normalizer.Form.NFC);
|
||||
ECKey key = ecMultiply ? decryptEC(normalizedPassphrase) : decryptNoEC(normalizedPassphrase);
|
||||
Sha256Hash hash = Sha256Hash.twiceOf(LegacyAddress.fromKey(params, key).toString().getBytes(Charsets.US_ASCII));
|
||||
Sha256Hash hash = Sha256Hash.twiceOf(LegacyAddress.fromKey(params, key).toString().getBytes(StandardCharsets.US_ASCII));
|
||||
byte[] actualAddressHash = Arrays.copyOfRange(hash.getBytes(), 0, 4);
|
||||
if (!Arrays.equals(actualAddressHash, addressHash))
|
||||
throw new BadPassphraseException();
|
||||
@ -126,7 +126,7 @@ public class BIP38PrivateKey extends PrefixedChecksummedBytes {
|
||||
|
||||
private ECKey decryptNoEC(String normalizedPassphrase) {
|
||||
try {
|
||||
byte[] derived = SCrypt.scrypt(normalizedPassphrase.getBytes(Charsets.UTF_8), addressHash, 16384, 8, 8, 64);
|
||||
byte[] derived = SCrypt.scrypt(normalizedPassphrase.getBytes(StandardCharsets.UTF_8), addressHash, 16384, 8, 8, 64);
|
||||
byte[] key = Arrays.copyOfRange(derived, 32, 64);
|
||||
SecretKeySpec keyspec = new SecretKeySpec(key, "AES");
|
||||
|
||||
@ -148,7 +148,7 @@ public class BIP38PrivateKey extends PrefixedChecksummedBytes {
|
||||
byte[] ownerEntropy = Arrays.copyOfRange(content, 0, 8);
|
||||
byte[] ownerSalt = hasLotAndSequence ? Arrays.copyOfRange(ownerEntropy, 0, 4) : ownerEntropy;
|
||||
|
||||
byte[] passFactorBytes = SCrypt.scrypt(normalizedPassphrase.getBytes(Charsets.UTF_8), ownerSalt, 16384, 8, 8, 32);
|
||||
byte[] passFactorBytes = SCrypt.scrypt(normalizedPassphrase.getBytes(StandardCharsets.UTF_8), ownerSalt, 16384, 8, 8, 32);
|
||||
if (hasLotAndSequence) {
|
||||
byte[] hashBytes = Bytes.concat(passFactorBytes, ownerEntropy);
|
||||
checkState(hashBytes.length == 40);
|
||||
|
@ -22,7 +22,6 @@ import org.bitcoinj.core.Utils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@ -30,6 +29,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -88,7 +88,7 @@ public class MnemonicCode {
|
||||
* is supplied the digest of the words will be checked.
|
||||
*/
|
||||
public MnemonicCode(InputStream wordstream, String wordListDigest) throws IOException, IllegalArgumentException {
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(wordstream, Charsets.UTF_8));
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(wordstream, StandardCharsets.UTF_8));
|
||||
this.wordList = new ArrayList<>(2048);
|
||||
MessageDigest md = Sha256Hash.newDigest();
|
||||
String word;
|
||||
|
@ -26,11 +26,10 @@ package org.bitcoinj.crypto;
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* <p>This is a clean-room implementation of PBKDF2 using RFC 2898 as a reference.</p>
|
||||
@ -74,13 +73,13 @@ public class PBKDF2SHA512 {
|
||||
byte[] U_LAST = null;
|
||||
byte[] U_XOR = null;
|
||||
|
||||
SecretKeySpec key = new SecretKeySpec(P.getBytes(Charsets.UTF_8), "HmacSHA512");
|
||||
SecretKeySpec key = new SecretKeySpec(P.getBytes(StandardCharsets.UTF_8), "HmacSHA512");
|
||||
Mac mac = Mac.getInstance(key.getAlgorithm());
|
||||
mac.init(key);
|
||||
|
||||
for (int j = 0; j < c; j++) {
|
||||
if (j == 0) {
|
||||
byte[] baS = S.getBytes(Charsets.UTF_8);
|
||||
byte[] baS = S.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] baI = INT(i);
|
||||
byte[] baU = new byte[baS.length + baI.length];
|
||||
|
||||
|
@ -20,12 +20,11 @@ import org.bitcoinj.core.*;
|
||||
import org.bitcoinj.utils.*;
|
||||
import org.slf4j.*;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import javax.annotation.*;
|
||||
import java.io.*;
|
||||
import java.nio.*;
|
||||
import java.nio.channels.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.*;
|
||||
|
||||
@ -133,7 +132,7 @@ public class SPVBlockStore implements BlockStore {
|
||||
if (exists) {
|
||||
header = new byte[4];
|
||||
buffer.get(header);
|
||||
if (!new String(header, Charsets.US_ASCII).equals(HEADER_MAGIC))
|
||||
if (!new String(header, StandardCharsets.US_ASCII).equals(HEADER_MAGIC))
|
||||
throw new BlockStoreException("Header bytes do not equal " + HEADER_MAGIC);
|
||||
} else {
|
||||
initNewStore(params);
|
||||
|
@ -20,12 +20,13 @@ package org.bitcoinj.wallet;
|
||||
import org.bitcoinj.core.Utils;
|
||||
import org.bitcoinj.crypto.*;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Splitter;
|
||||
import org.spongycastle.crypto.params.KeyParameter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.List;
|
||||
|
||||
@ -188,7 +189,7 @@ public class DeterministicSeed implements EncryptableItem {
|
||||
}
|
||||
|
||||
private byte[] getMnemonicAsBytes() {
|
||||
return Utils.SPACE_JOINER.join(mnemonicCode).getBytes(Charsets.UTF_8);
|
||||
return Utils.SPACE_JOINER.join(mnemonicCode).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
public DeterministicSeed decrypt(KeyCrypter crypter, String passphrase, KeyParameter aesKey) {
|
||||
@ -236,7 +237,7 @@ public class DeterministicSeed implements EncryptableItem {
|
||||
}
|
||||
|
||||
private static List<String> decodeMnemonicCode(byte[] mnemonicCode) {
|
||||
return decodeMnemonicCode(new String(mnemonicCode, Charsets.UTF_8));
|
||||
return decodeMnemonicCode(new String(mnemonicCode, StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
private static List<String> decodeMnemonicCode(String mnemonicCode) {
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
package org.bitcoinj.core;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.*;
|
||||
import org.bitcoinj.core.listeners.*;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
@ -43,6 +42,7 @@ import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketException;
|
||||
import java.nio.channels.CancelledKeyException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@ -774,7 +774,7 @@ public class PeerTest extends TestWithNetworkConnections {
|
||||
Transaction t2 = new Transaction(UNITTEST);
|
||||
t2.setLockTime(999999);
|
||||
// Add a fake input to t3 that goes nowhere.
|
||||
Sha256Hash t3 = Sha256Hash.of("abc".getBytes(Charsets.UTF_8));
|
||||
Sha256Hash t3 = Sha256Hash.of("abc".getBytes(StandardCharsets.UTF_8));
|
||||
t2.addInput(new TransactionInput(UNITTEST, t2, new byte[]{}, new TransactionOutPoint(UNITTEST, 0, t3)));
|
||||
t2.getInput(0).setSequenceNumber(0xDEADBEEF);
|
||||
t2.addOutput(COIN, new ECKey());
|
||||
|
@ -26,7 +26,6 @@ import org.bitcoinj.crypto.TransactionSignature;
|
||||
import org.bitcoinj.params.MainNetParams;
|
||||
import org.bitcoinj.params.TestNet3Params;
|
||||
import org.bitcoinj.script.Script.VerifyFlag;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@ -39,6 +38,7 @@ import org.slf4j.LoggerFactory;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigInteger;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
import static org.bitcoinj.core.Utils.HEX;
|
||||
@ -254,7 +254,7 @@ public class ScriptTest {
|
||||
} else if (w.length() >= 2 && w.startsWith("'") && w.endsWith("'")) {
|
||||
// Single-quoted string, pushed as data. NOTE: this is poor-man's
|
||||
// parsing, spaces/tabs/newlines in single-quoted strings won't work.
|
||||
Script.writeBytes(out, w.substring(1, w.length() - 1).getBytes(Charsets.UTF_8));
|
||||
Script.writeBytes(out, w.substring(1, w.length() - 1).getBytes(StandardCharsets.UTF_8));
|
||||
} else if (ScriptOpCodes.getOpCode(w) != OP_INVALIDOPCODE) {
|
||||
// opcode, e.g. OP_ADD or OP_1:
|
||||
out.write(ScriptOpCodes.getOpCode(w));
|
||||
@ -286,7 +286,7 @@ public class ScriptTest {
|
||||
@Test
|
||||
public void dataDrivenScripts() throws Exception {
|
||||
JsonNode json = new ObjectMapper()
|
||||
.readTree(new InputStreamReader(getClass().getResourceAsStream("script_tests.json"), Charsets.UTF_8));
|
||||
.readTree(new InputStreamReader(getClass().getResourceAsStream("script_tests.json"), StandardCharsets.UTF_8));
|
||||
for (JsonNode test : json) {
|
||||
if (test.size() == 1)
|
||||
continue; // skip comment
|
||||
@ -358,7 +358,7 @@ public class ScriptTest {
|
||||
@Test
|
||||
public void dataDrivenValidTransactions() throws Exception {
|
||||
JsonNode json = new ObjectMapper().readTree(new InputStreamReader(getClass().getResourceAsStream(
|
||||
"tx_valid.json"), Charsets.UTF_8));
|
||||
"tx_valid.json"), StandardCharsets.UTF_8));
|
||||
for (JsonNode test : json) {
|
||||
if (test.isArray() && test.size() == 1 && test.get(0).isTextual())
|
||||
continue; // This is a comment.
|
||||
@ -389,7 +389,7 @@ public class ScriptTest {
|
||||
@Test
|
||||
public void dataDrivenInvalidTransactions() throws Exception {
|
||||
JsonNode json = new ObjectMapper().readTree(new InputStreamReader(getClass().getResourceAsStream(
|
||||
"tx_invalid.json"), Charsets.UTF_8));
|
||||
"tx_invalid.json"), StandardCharsets.UTF_8));
|
||||
for (JsonNode test : json) {
|
||||
if (test.isArray() && test.size() == 1 && test.get(0).isTextual())
|
||||
continue; // This is a comment.
|
||||
|
@ -31,7 +31,6 @@ import org.bitcoinj.utils.BriefLogFormatter;
|
||||
import org.bitcoinj.utils.Threading;
|
||||
import org.bitcoinj.wallet.listeners.AbstractKeyChainEventListener;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
@ -42,6 +41,7 @@ import org.junit.Test;
|
||||
import org.spongycastle.crypto.params.KeyParameter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.List;
|
||||
|
||||
@ -693,7 +693,7 @@ public class DeterministicKeyChainTest {
|
||||
private String checkSerialization(List<Protos.Key> keys, String filename) {
|
||||
try {
|
||||
String sb = protoToString(keys);
|
||||
List<String> lines = Resources.readLines(getClass().getResource(filename), Charsets.UTF_8);
|
||||
List<String> lines = Resources.readLines(getClass().getResource(filename), StandardCharsets.UTF_8);
|
||||
String expected = Joiner.on('\n').join(lines);
|
||||
assertEquals(expected, sb);
|
||||
return expected;
|
||||
|
@ -27,7 +27,6 @@ import org.bitcoinj.store.BlockStore;
|
||||
import org.bitcoinj.store.MemoryBlockStore;
|
||||
import org.bitcoinj.utils.BriefLogFormatter;
|
||||
import org.bitcoinj.utils.Threading;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Resources;
|
||||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
@ -43,6 +42,7 @@ import java.io.PrintWriter;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.DigestOutputStream;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
@ -69,7 +69,7 @@ public class BuildCheckpoints {
|
||||
OptionSet options = parser.parse(args);
|
||||
|
||||
if (options.has("help")) {
|
||||
System.out.println(Resources.toString(BuildCheckpoints.class.getResource("build-checkpoints-help.txt"), Charsets.UTF_8));
|
||||
System.out.println(Resources.toString(BuildCheckpoints.class.getResource("build-checkpoints-help.txt"), StandardCharsets.UTF_8));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ public class BuildCheckpoints {
|
||||
}
|
||||
|
||||
private static void writeTextualCheckpoints(TreeMap<Integer, StoredBlock> checkpoints, File file) throws IOException {
|
||||
PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), Charsets.US_ASCII));
|
||||
PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.US_ASCII));
|
||||
writer.println("TXT CHECKPOINTS 1");
|
||||
writer.println("0"); // Number of signatures to read. Do this later.
|
||||
writer.println(checkpoints.size());
|
||||
|
@ -34,7 +34,6 @@ import org.bitcoinj.utils.BriefLogFormatter;
|
||||
import org.bitcoinj.wallet.DeterministicSeed;
|
||||
import org.bitcoinj.wallet.DeterministicUpgradeRequiredException;
|
||||
import org.bitcoinj.wallet.DeterministicUpgradeRequiresPassword;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.io.Resources;
|
||||
@ -95,6 +94,7 @@ import java.io.*;
|
||||
import java.math.BigInteger;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.SecureRandom;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -266,7 +266,7 @@ public class WalletTool {
|
||||
|
||||
if (args.length == 0 || options.has("help") ||
|
||||
options.nonOptionArguments().size() < 1 || options.nonOptionArguments().contains("help")) {
|
||||
System.out.println(Resources.toString(WalletTool.class.getResource("wallet-tool-help.txt"), Charsets.UTF_8));
|
||||
System.out.println(Resources.toString(WalletTool.class.getResource("wallet-tool-help.txt"), StandardCharsets.UTF_8));
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user