mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
improve transaction file opening io
This commit is contained in:
parent
ada8ca28e8
commit
63ec856e87
1 changed files with 2 additions and 4 deletions
|
@ -69,6 +69,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -454,10 +455,7 @@ public class AppController implements Initializable {
|
||||||
|
|
||||||
if(file.exists()) {
|
if(file.exists()) {
|
||||||
try {
|
try {
|
||||||
byte[] bytes = new byte[(int)file.length()];
|
byte[] bytes = Files.readAllBytes(file.toPath());
|
||||||
FileInputStream stream = new FileInputStream(file);
|
|
||||||
stream.read(bytes);
|
|
||||||
stream.close();
|
|
||||||
String name = file.getName();
|
String name = file.getName();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue