Add floating console support
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.stardust.pio;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.List;
|
||||
* Created by Stardust on 2017/4/1.
|
||||
*/
|
||||
|
||||
public class PReadableTextFile extends PFile {
|
||||
public class PReadableTextFile extends PFile implements Closeable {
|
||||
|
||||
private BufferedReader mBufferedReader;
|
||||
private FileInputStream mFileInputStream;
|
||||
@@ -91,6 +91,7 @@ public class PReadableTextFile extends PFile {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
try {
|
||||
if (mBufferedReader != null) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.stardust.pio;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.Closeable;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -13,7 +14,7 @@ import java.util.List;
|
||||
* Created by Stardust on 2017/4/1.
|
||||
*/
|
||||
|
||||
public class PWritableTextFile extends PFile {
|
||||
public class PWritableTextFile extends PFile implements Closeable {
|
||||
|
||||
public static PWritableTextFile open(String path, String encoding, int bufferSize) {
|
||||
return new PWritableTextFile(path, encoding, bufferSize, false);
|
||||
|
||||
Reference in New Issue
Block a user