public class ConcurrentDiskUtil extends Object
| Constructor and Description |
|---|
ConcurrentDiskUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
byteBufferToString(ByteBuffer buffer,
String charsetName)
transfer ByteBuffer to String
|
static String |
getFileContent(File file,
String charsetName)
get file content
|
static String |
getFileContent(String path,
String charsetName)
get file content
|
static Boolean |
writeFileContent(File file,
String content,
String charsetName)
write file content
|
static Boolean |
writeFileContent(String path,
String content,
String charsetName)
write file content
|
public static String getFileContent(String path, String charsetName) throws IOException
path - file pathcharsetName - charsetNameIOException - IOExceptionpublic static String getFileContent(File file, String charsetName) throws IOException
file - filecharsetName - charsetNameIOException - IOExceptionpublic static Boolean writeFileContent(String path, String content, String charsetName) throws IOException
path - file pathcontent - contentcharsetName - charsetNameIOException - IOExceptionpublic static Boolean writeFileContent(File file, String content, String charsetName) throws IOException
file - filecontent - contentcharsetName - charsetNameIOException - IOExceptionpublic static String byteBufferToString(ByteBuffer buffer, String charsetName) throws IOException
buffer - buffercharsetName - charsetNameIOException - IOExceptionCopyright © 2018–2020 Alibaba Group. All rights reserved.