@Override public void write(Object object, ObjectOutput out) throws IOException { byte[] data = ((MarshObject) object).getBytes(); out.writeInt(data.length); if (data.length > 0) { out.write(data); // out.flush(); } }
public Object getObject(MarshObject marsh) throws IOException, ClassNotFoundException { return getObject(marsh.getBytes()); }
public Object getObject(MarshObject marsh) throws IOException, ClassNotFoundException { if (!(marsh instanceof CompressedMarshObject)) throw new IOException("Can decompress only CompressedMarshObject"); _bai.setBuffer(marsh.getBytes()); _zi.getNextEntry(); if (_oi == null) { _oi = getObjectInputStream(_zi); } Object object = _oi.readObject(); // It seems ZipInputStream has some internal state and it needs // to be cleared both before and after setting the underlying // InputStream // buffer _zi.getNextEntry(); _bai.setBuffer(DUMMY_BUFFER); return object; }
if (_serUID) { try { basicName = new String(mc.getMarshObject(name).getBytes(), "ISO-8859-1"); validate = false; } catch (IOException e) {