Menu

#7 bug in XMLSerializationOPS.java

open
nobody
None
5
2005-07-25
2005-07-25
psmith
No

Hello!
There is an bug in file
org/mandarax/zkb/XMLSerializationOPS.java
In method importObjects(InputStream in), the type of
variable "b" should be "int", not "byte". It cannot
load file with utf-8 characters.
Fixed version of this method:
public void importObjects(InputStream in) throws
IOException {
// buffer, otherwise closing the decoder closes the
stream
ByteArrayOutputStream buf = new ByteArrayOutputStream();
int b = -1;
while ((b=in.read())>-1) buf.write(b);
InputStream bin = new
ByteArrayInputStream(buf.toByteArray());
...

Hope this helps,
Suller Andras

Discussion


Log in to post a comment.