/** * Uses protobuf serialization to save the wallet to the given file stream. To learn more about this file format, see * {@link WalletProtobufSerializer}. */ public void saveToFileStream(OutputStream f) throws IOException { lock.lock(); try { WalletProtobufSerializer.writeWallet(this, f); } finally { lock.unlock(); } }