io.neow3j.utils.Files Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
neow3j: Java/Kotlin/Android Development Toolkit for the Neo Blockchain
package io.neow3j.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
/**
* File utility functions.
*/
public class Files {
private Files() { }
public static byte[] readBytes(File file) throws IOException {
byte[] bytes = new byte[(int) file.length()];
try (FileInputStream fileInputStream = new FileInputStream(file)) {
fileInputStream.read(bytes);
}
return bytes;
}
public static String readString(File file) throws IOException {
return new String(readBytes(file));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy