Fix write issue.
This commit is contained in:
parent
6ed1e3b20b
commit
984a96da07
1 changed files with 43 additions and 1 deletions
|
@ -49,6 +49,34 @@ public class StringListWriter extends Writer
|
|||
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
String result;
|
||||
|
||||
result = this.out.toString();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public StringList toStringList()
|
||||
{
|
||||
StringList result;
|
||||
|
||||
result = this.out;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
@ -63,7 +91,21 @@ public class StringListWriter extends Writer
|
|||
@Override
|
||||
public void write(final char[] cbuf, final int off, final int len) throws IOException
|
||||
{
|
||||
this.out.append(cbuf.toString().substring(off, len));
|
||||
char[] target;
|
||||
if ((off == 0) && (cbuf.length == len))
|
||||
{
|
||||
target = cbuf;
|
||||
}
|
||||
else
|
||||
{
|
||||
target = new char[len];
|
||||
for (int index = off; index < len; index++)
|
||||
{
|
||||
target[index] = cbuf[index];
|
||||
}
|
||||
}
|
||||
|
||||
this.out.append(target.toString());
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue