mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-12 02:10:30 +00:00
Merge pull request #253 from SquidDev-CC/hotfix/empty-files
Fix files not writing data when closed
This commit is contained in:
commit
b86708aaf8
@ -23,7 +23,11 @@ public class EncodedInputHandle extends HandleGeneric
|
||||
|
||||
public EncodedInputHandle( InputStream stream, String encoding )
|
||||
{
|
||||
super( stream );
|
||||
this( makeReader( stream, encoding ) );
|
||||
}
|
||||
|
||||
private static BufferedReader makeReader( InputStream stream, String encoding )
|
||||
{
|
||||
if( encoding == null ) encoding = "UTF-8";
|
||||
InputStreamReader streamReader;
|
||||
try
|
||||
@ -34,7 +38,7 @@ public class EncodedInputHandle extends HandleGeneric
|
||||
{
|
||||
streamReader = new InputStreamReader( stream );
|
||||
}
|
||||
this.m_reader = new BufferedReader( streamReader );
|
||||
return new BufferedReader( streamReader );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -23,7 +23,11 @@ public class EncodedOutputHandle extends HandleGeneric
|
||||
|
||||
public EncodedOutputHandle( OutputStream stream, String encoding )
|
||||
{
|
||||
super( stream );
|
||||
this( makeWriter( stream, encoding ) );
|
||||
}
|
||||
|
||||
private static BufferedWriter makeWriter( OutputStream stream, String encoding )
|
||||
{
|
||||
if( encoding == null ) encoding = "UTF-8";
|
||||
OutputStreamWriter streamWriter;
|
||||
try
|
||||
@ -34,7 +38,7 @@ public class EncodedOutputHandle extends HandleGeneric
|
||||
{
|
||||
streamWriter = new OutputStreamWriter( stream );
|
||||
}
|
||||
this.m_writer = new BufferedWriter( streamWriter );
|
||||
return new BufferedWriter( streamWriter );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
Loading…
Reference in New Issue
Block a user