public final class Files extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Files.Content
Wrap of file content
|
Constructor and Description |
---|
Files() |
Modifier and Type | Method and Description |
---|---|
static File |
getJarPath()
Return jar file path
|
static Files.Content |
read(File file)
Try to read a file as string or read as hex if the data is binary
|
static byte[] |
readBinary(File file) |
static Object |
readObject(File file) |
static String |
readText(File file)
Try to read a file as string
|
static String |
readText(File file,
Charset cs) |
static void |
writeBinary(File file,
byte[] bytes) |
static void |
writeObject(Object object,
File file) |
public static File getJarPath()
public static Object readObject(File file) throws IOException, ClassNotFoundException
file
- IOException
ClassNotFoundException
public static void writeObject(Object object, File file) throws IOException
object
- file
- IOException
public static Files.Content read(File file) throws IOException
file
- IOException
public static byte[] readBinary(File file) throws IOException
file
- IOException
public static void writeBinary(File file, byte[] bytes) throws IOException
file
- IOException
public static String readText(File file) throws IOException
file
- IOException
public static String readText(File file, Charset cs) throws IOException
file
- cs
- IOException
Copyright © 2018 Eclipse Paho. All rights reserved.