public static Object deserialize(byte[] blob) throws IOException, ClassNotFoundException { return deserialize(blob, false); }
public Object getObject(boolean unzip) throws IOException, ClassNotFoundException { if (isBytes()) { return this.part; } else { if (this.version != null) { return CacheServerHelper.deserialize((byte[]) this.part, this.version, unzip); } else { return CacheServerHelper.deserialize((byte[]) this.part, unzip); } } }
public Object getValue() { if (isDeserialized || value == null) { return value; } try { value = CacheServerHelper.deserialize((byte[]) value); } catch (IOException ioe) { throw new RuntimeException( "IOException deserializing value", ioe); } catch (ClassNotFoundException cnfe) { throw new RuntimeException( "ClassNotFoundException deserializing value", cnfe); } isDeserialized = true; return value; }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.hasKeys = in.readBoolean(); if (this.hasKeys) { this.keys = new ArrayList(); } int numObjects = in.readInt(); if (numObjects > 0) { for (int index = 0; index < numObjects; ++index) { if (this.hasKeys) { Object key = DataSerializer.readObject(in); this.keys.add(key); } boolean isException = in.readBoolean(); Object value; if (isException) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else { value = DataSerializer.readObject(in); } this.objects.add(value); } } }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { boolean keysPresent = in.readBoolean(); if (keysPresent) { this.keys = new ArrayList(); } this.hasKeys = keysPresent; int numObjects = in.readInt(); this.objectTypeArray = new byte[numObjects]; if (numObjects > 0) { for (int index = 0; index < numObjects; ++index) { if (keysPresent) { Object key = DataSerializer.readObject(in); this.keys.add(key); } byte objectType = in.readByte(); this.objectTypeArray[index] = objectType; Object value; if (objectType == EXCEPTION) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else { value = DataSerializer.readObject(in); } this.objects.add(value); } } }
@Override public void fromData(DataInput in) throws IOException, ClassNotFoundException { boolean keysPresent = in.readBoolean(); if (keysPresent) { this.keys = new ArrayList(); } this.hasKeys = keysPresent; int numObjects = in.readInt(); this.objectTypeArray = new byte[numObjects]; if (numObjects > 0) { for (int index = 0; index < numObjects; ++index) { if (keysPresent) { Object key = DataSerializer.readObject(in); this.keys.add(key); } byte objectType = in.readByte(); this.objectTypeArray[index] = objectType; Object value; if (objectType == EXCEPTION) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else { value = DataSerializer.readByteArray(in); } this.objects.add(value); } } }
private void readObject(int index, DataInput in) throws IOException, ClassNotFoundException { Object value; this.objectTypeArray[index] = in.readByte(); if (logger.isTraceEnabled(LogMarker.VERSIONED_OBJECT_LIST_VERBOSE)) { logger.trace(LogMarker.VERSIONED_OBJECT_LIST_VERBOSE, "reading object {} of type {}", index, objectTypeArray[index]); } boolean isException = this.objectTypeArray[index] == EXCEPTION; if (isException) { byte[] exBytes = DataSerializer.readByteArray(in); value = CacheServerHelper.deserialize(exBytes); // ignore the exception string meant for native clients DataSerializer.readString(in); } else if (this.serializeValues) { value = DataSerializer.readByteArray(in); } else { value = DataSerializer.readObject(in); } this.objects.add(value); }
for (int i = 0; i < noOfParts - 1; i += 3) { instantiatorClassName = (String) CacheServerHelper.deserialize(clientMessage.getPart(i).getSerializedForm()); String instantiatedClassName = (String) CacheServerHelper .deserialize(clientMessage.getPart(i + 1).getSerializedForm()); int id = clientMessage.getPart(i + 2).getInt(); InternalInstantiator.register(instantiatorClassName, instantiatedClassName, id, false,
try { String dataSerializerClassName = (String) CacheServerHelper.deserialize(msg.getPart(i).getSerializedForm()); int id = msg.getPart(i + 1).getInt(); InternalDataSerializer.register(dataSerializerClassName, false, eventId, null, id); for (; j < numOfClasses; j++) { String className = (String) CacheServerHelper.deserialize(msg.getPart(i + 3 + j).getSerializedForm()); InternalDataSerializer.updateSupportedClassesMap(dataSerializerClassName, className);
serializedInstantiators[i] = instantiatorPart.getSerializedForm(); String instantiatorClassName = (String) CacheServerHelper.deserialize(serializedInstantiators[i]); (String) CacheServerHelper.deserialize(serializedInstantiators[i + 1]);
serializedDataSerializers[i] = dataSerializerClassNamePart.getSerializedForm(); String dataSerializerClassName = (String) CacheServerHelper.deserialize(serializedDataSerializers[i]);