Package org.bitcoinj.store

Examples of org.bitcoinj.store.WalletProtobufSerializer


            return data;
        }
    }

    public org.bitcoinj.wallet.Protos.Wallet serialize() {
        WalletProtobufSerializer serializer = new WalletProtobufSerializer();
        return serializer.walletToProto(this);
    }
View Full Code Here


        System.out.println(roundTrip(wallet));
    }

    private static Wallet roundTrip(Wallet wallet) throws Exception {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        new WalletProtobufSerializer().writeWallet(wallet, output);
        ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray());
        return PledgingWallet.deserialize(Protos.Wallet.parseFrom(input));
    }
View Full Code Here

        WalletProtobufSerializer serializer = new WalletProtobufSerializer();
        return serializer.walletToProto(this);
    }

    public static PledgingWallet deserialize(org.bitcoinj.wallet.Protos.Wallet proto) throws UnreadableWalletException {
        WalletProtobufSerializer serializer = new WalletProtobufSerializer(PledgingWallet::new);
        NetworkParameters params = NetworkParameters.fromID(proto.getNetworkIdentifier());
        return (PledgingWallet) serializer.readWallet(params, new WalletExtension[]{new PledgeStorage(null)}, proto);
    }
View Full Code Here

TOP

Related Classes of org.bitcoinj.store.WalletProtobufSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.