public static Object deserialize(byte[] blob) throws IOException, ClassNotFoundException { return deserialize(blob, false); }
public static byte[] serialize(Object obj) throws IOException { return serialize(obj, false); }
public String getString() { if (this.part == null) { return null; } if (!isBytes()) { Assert.assertTrue(false, "expected String part to be of type BYTE, part =" + this.toString()); } return CacheServerHelper.fromUTF((byte[])this.part); }
public static Object deserialize(byte[] blob, boolean unzipObject) throws IOException, ClassNotFoundException { return unzipObject ? unzip(blob) : BlobHelper.deserializeBlob(blob); }
public static byte[] serialize(Object obj, boolean zipObject) throws IOException { return zipObject ? zip(obj) : BlobHelper.serializeToBlob(obj); }
public static Object deserialize(byte[] blob, Version version, boolean unzipObject) throws IOException, ClassNotFoundException { return unzipObject ? unzip(blob) : BlobHelper.deserializeBlob(blob, version, null); }
public static byte[] serialize(Object obj, boolean zipObject) throws IOException { return zipObject ? zip(obj) : BlobHelper.serializeToBlob(obj); }
public static Object deserialize(byte[] blob) throws IOException, ClassNotFoundException { return deserialize(blob, false); }
public static byte[] serialize(Object obj) throws IOException { return serialize(obj, false); }
public static Object deserialize(byte[] blob, boolean unzipObject) throws IOException, ClassNotFoundException { return unzipObject ? unzip(blob) : BlobHelper.deserializeBlob(blob); }
public String getString() { if (this.part == null) { return null; } if (!isBytes()) { Assert.assertTrue(false, "expected String part to be of type BYTE, part =" + this.toString()); } return CacheServerHelper.fromUTF((byte[])this.part); }
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 getObject() throws IOException, ClassNotFoundException {
@Override public void importNewObject(Object nv, boolean isSerialized) { if (!isSerialized) { throw new IllegalStateException("Expected importNewBytes to be called."); } try { this._value = CacheServerHelper.serialize(nv); } catch (IOException e) { throw new GemFireIOException("Exception serializing entry value", e); } }
public Object getObject(boolean unzip) throws IOException, ClassNotFoundException { if (isBytes()) { return this.part; } else { return CacheServerHelper.deserialize((byte[])this.part, unzip); } } public Object getObject() throws IOException, ClassNotFoundException {
private void serializeKey() throws IOException { if (!keyIsSerialized && isInitialized()) { this.serializedKey = CacheServerHelper.serialize(this.key); keyIsSerialized = true; } }
public Object getValue() { if(isDeserialized || value == null) { return value; } try { value = CacheServerHelper.deserialize((byte[])value); } catch(IOException ioe) { throw new RuntimeException(LocalizedStrings.InterestEvent_IOEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), ioe); } catch(ClassNotFoundException cnfe) { throw new RuntimeException(LocalizedStrings.InterestEvent_CLASSNOTFOUNDEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), cnfe); } isDeserialized = true; return value; }
@Override public void importNewObject(Object nv, boolean isSerialized) { if (!isSerialized) { throw new IllegalStateException("Expected importNewBytes to be called."); } try { this._value = CacheServerHelper.serialize(nv); } catch (IOException e) { throw new GemFireIOException("Exception serializing entry value", e); } }
public Object getValue() { if(isDeserialized || value == null) { return value; } try { value = CacheServerHelper.deserialize((byte[])value); } catch(IOException ioe) { throw new RuntimeException(LocalizedStrings.InterestEvent_IOEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), ioe); } catch(ClassNotFoundException cnfe) { throw new RuntimeException(LocalizedStrings.InterestEvent_CLASSNOTFOUNDEXCEPTION_DESERIALIZING_VALUE.toLocalizedString(), cnfe); } isDeserialized = true; return value; }
private void serializeKey() throws IOException { if (!keyIsSerialized && isInitialized()) { this.serializedKey = CacheServerHelper.serialize(this.key); keyIsSerialized = true; } } /**MergeGemXDHDFSToGFE This function needs to enabled if similar functionality is added to gatewaysendereventimpl*/
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); } } }