Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
public int __id = -1;
public int __getId() {
    return __id;
}
public void __setId(int id) {
    this.__id= id;
}
public void __deserialize(byte[] buffer, boolean lazy) throws java.lang.Exception {
    java.io.DataInputStream dis = new java.io.DataInputStream(new java.io.ByteArrayInputStream(buffer));
    javax.microedition.rms.RecordStore superRS = net.sourceforge.floggy.persistence.impl.PersistableManagerImpl.getRecordStore(super.getRecordStoreName(), net.sourceforge.floggy.persistence.impl.MetadataManagerUtil.getClassBasedMetadata("net.sourceforge.floggy.persistence.fr2243450.SuperNamedClass"));
    int superClassId = dis.readInt();
    byte[] superClassBuffer = superRS.getRecord(superClassId);
    net.sourceforge.floggy.persistence.impl.PersistableManagerImpl.closeRecordStore(superRS);
    super.__deserialize(superClassBuffer, lazy);
    super.__setId(superClassId);
    this.x= net.sourceforge.floggy.persistence.impl.SerializationHelper.readString(dis);
    dis.close();
}
public byte[] __serialize() throws java.lang.Exception {
    net.sourceforge.floggy.persistence.impl.FloggyOutputStream fos= new net.sourceforge.floggy.persistence.impl.FloggyOutputStream();
    javax.microedition.rms.RecordStore superRS = net.sourceforge.floggy.persistence.impl.PersistableManagerImpl.getRecordStore(super.getRecordStoreName(), net.sourceforge.floggy.persistence.impl.MetadataManagerUtil.getClassBasedMetadata("net.sourceforge.floggy.persistence.fr2243450.SuperNamedClass"));
    byte[] superBuffer= super.__serialize();
    int superId= super.__getId();
    if(superId <= 0) {
        superId = superRS.addRecord(superBuffer, 0, superBuffer.length);
        super.__setId(superId);
    }
    else {
        superRS.setRecord(superId, superBuffer, 0, superBuffer.length);
    }
    net.sourceforge.floggy.persistence.impl.PersistableManagerImpl.closeRecordStore(superRS);
    fos.writeInt(superId);
    net.sourceforge.floggy.persistence.impl.SerializationHelper.writeString(fos, x);
    fos.flush();
    return fos.toByteArray();
}
public void __delete() throws java.lang.Exception {
    super.__delete();
    javax.microedition.rms.RecordStore superRS = net.sourceforge.floggy.persistence.impl.PersistableManagerImpl.getRecordStore(super.getRecordStoreName(), net.sourceforge.floggy.persistence.impl.MetadataManagerUtil.getClassBasedMetadata(super.getClass().getName()));
    try {
        superRS.deleteRecord(super.__getId());
        super.__setId(0);
        } finally {
        net.sourceforge.floggy.persistence.impl.PersistableManagerImpl.closeRecordStore(superRS);
    }
}
New to GrepCode? Check out our FAQ X