code: private static final Serializable deserialize(byte[] array, int offset, int length) throws IOException, ClassNotFoundException {  
  
  	   ByteArrayInputStream byteArrayInputStream = null;
  	  ObjectInputStream objectInputStream = null;
  	  try {
            byteArrayInputStream = new ByteArrayInputStream(array, offset, length);
  		  byteArrayInputStream.mark(array.length);
        	  objectInputStream = new ObjectInputStream(byteArrayInputStream);
  
  		  return (Serializable) objectInputStream.readObject();
  	  } catch (ClassNotFoundException cnfe) {
  		  ClassLoader cl = getClassLoader();
  		  if (cl != null) {
  			  byteArrayInputStream.reset();
            	  objectInputStream = new WsObjectInputStream(byteArrayInputStream, cl);
  			  return (Serializable) objectInputStream.readObject();
  		  } else {
  			  throw cnfe;
  		  }
  	  } catch (NoClassDefFoundError cnfe) {
  		  ClassLoader cl = getClassLoader();
  		  if (cl != null) {
  			  byteArrayInputStream.reset();
            	  objectInputStream = new WsObjectInputStream(byteArrayInputStream, cl);
  			  return (Serializable) objectInputStream.readObject();
  		  } else {
  			  throw cnfe;
  		  }	    
  	  } catch (StreamCorruptedException cnfe) {
  		  ClassLoader cl = getClassLoader();
  		  if (cl != null) {
  			  byteArrayInputStream.reset();
            	  objectInputStream = new WsObjectInputStream(byteArrayInputStream, cl);
  			  return (Serializable) objectInputStream.readObject();
  		  } else {
  			  throw cnfe;
  		  }
  	  } finally { 
            if (byteArrayInputStream != null) {
                byteArrayInputStream.close();
            }
            if (objectInputStream != null) {
                objectInputStream.close();
            }
        }
     }
docs: This deserializes a byte array into an object.
  @param array The object to be deserialized.
  @return The deserialized object.