示例#1
0
 private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
   name = (String) in.readObject();
   Log.d(TAG, "Read name: " + name);
   resourceId = in.readInt();
   value = in.readInt();
   long vectorSize = in.readLong();
   if (vectorSize <= 0) {
     return;
   }
   IpointVector ipv = new IpointVector(vectorSize);
   Log.d(TAG, "VectorSize: " + vectorSize);
   for (int j = 0; j < vectorSize; j++) {
     Ipoint p = new Ipoint();
     p.setX(in.readFloat());
     p.setY(in.readFloat());
     p.setScale(in.readFloat());
     p.setOrientation(in.readFloat());
     p.setLaplacian(in.readInt());
     p.setDx(in.readFloat());
     p.setDy(in.readFloat());
     p.setClusterIndex(in.readInt());
     p.setDescriptor((float[]) in.readObject());
     ipv.add(p);
   }
   setIptv(ipv);
 }
示例#2
0
 private void writeObject(java.io.ObjectOutputStream out) throws IOException {
   out.writeObject(name);
   out.writeInt(resourceId);
   out.writeInt(value);
   if (iptv == null) {
     // No POI vector
     out.writeInt(0);
     return;
   }
   long vectorSize = iptv.size();
   out.writeLong(vectorSize);
   Log.d(TAG, "Written vector size: " + vectorSize);
   for (int j = 0; j < vectorSize; j++) {
     Ipoint p = iptv.get(j);
     out.writeFloat(p.getX());
     out.writeFloat(p.getY());
     out.writeFloat(p.getScale());
     out.writeFloat(p.getOrientation());
     out.writeInt(p.getLaplacian());
     out.writeFloat(p.getDx());
     out.writeFloat(p.getDy());
     out.writeInt(p.getClusterIndex());
     out.writeObject(p.getDescriptor());
   }
 }