fix: clear buffer of line writer file
This commit is contained in:
parent
ccf75d6066
commit
deaebac5fe
@ -1,4 +1,4 @@
|
||||
project_group = me.topchetoeu
|
||||
project_name = jscript
|
||||
project_version = 0.9.5-beta
|
||||
project_version = 0.9.6-beta
|
||||
main_class = me.topchetoeu.jscript.utils.JScriptRepl
|
||||
|
@ -24,6 +24,11 @@ public class Buffer {
|
||||
return n;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
data = new byte[128];
|
||||
length = 0;
|
||||
}
|
||||
|
||||
public void append(byte b) {
|
||||
write(length, new byte[] { b });
|
||||
}
|
||||
|
@ -99,6 +99,7 @@ public interface File {
|
||||
if (b == '\n') {
|
||||
try {
|
||||
writer.writeLine(new String(buff.data()));
|
||||
buff.clear();
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new FilesystemException(ErrorReason.UNKNOWN, e.getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user