List of usage examples for java.io ObjectStreamConstants STREAM_MAGIC
short STREAM_MAGIC
To view the source code for java.io ObjectStreamConstants STREAM_MAGIC.
Click Source Link
From source file:org.mule.module.redis.RedisUtils.java
public static Serializable fromBytes(final byte[] bytes) { if ((bytes == null) || (bytes.length == 0)) { return null; }//from w w w. java2s. com if ((bytes[0] == (byte) ((ObjectStreamConstants.STREAM_MAGIC >>> 8) & 0xFF))) { final Object deserialized = SerializationUtils.deserialize(bytes); if (deserialized instanceof Serializable) { return (Serializable) deserialized; } else { return bytes; } } else { return SafeEncoder.encode(bytes); } }