XMLDecoder problem
I have the following code in my servlet:
InputStream inp = rs.getBinaryStream("cells");
try{
// BufferedReader reader = new BufferedReader(new InputStreamReader(inp));
// while (reader.ready()) System.err.println(reader.readLine());
XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(inp));
CellBean[][] cells = (CellBean[][]) decoder.readObject();
grid.setCells(cells);
decoder.close();
}
catch(Exception ex){
// do smth
}
First time i call servlet, decoder.readObject() returns null. Next calls successfully return an array of CellBeans. When i tried to uncomment the lines with reader, it returned me xml for my array, so I'm sure the problem is in XMLDecoder. What the hell is going on with it?
InputStream inp = rs.getBinaryStream("cells");
try{
// BufferedReader reader = new BufferedReader(new InputStreamReader(inp));
// while (reader.ready()) System.err.println(reader.readLine());
XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(inp));
CellBean[][] cells = (CellBean[][]) decoder.readObject();
grid.setCells(cells);
decoder.close();
}
catch(Exception ex){
// do smth
}
First time i call servlet, decoder.readObject() returns null. Next calls successfully return an array of CellBeans. When i tried to uncomment the lines with reader, it returned me xml for my array, so I'm sure the problem is in XMLDecoder. What the hell is going on with it?
