Java Code Examples for java.io.ObjectInputStream#readUnshared()

The following examples show how to use java.io.ObjectInputStream#readUnshared() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public Object deserialize(String keyOnCacheClient) {
    if (!keyOnCacheClient.startsWith("$")) {
        return keyOnCacheClient;
    }
    Object notSerializable = notSerializableKeys.get(keyOnCacheClient);
    if (notSerializable != null) {
        return notSerializable;
    }
    try {
        byte[] decoded = Base64.getDecoder().decode(keyOnCacheClient.substring(1));
        ByteArrayInputStream oo = new ByteArrayInputStream(decoded);
        ObjectInputStream o = new ObjectInputStream(oo);
        return o.readUnshared();
    } catch (IOException | ClassNotFoundException err) {
        throw new CacheException(err);
    }
}
 
Example 2
Source Project: DeepDriver   File: Fs.java    License: Apache License 2.0 5 votes vote down vote up
public static Object readObjFromFile(String file) throws Exception {
	ObjectInputStream is = new ObjectInputStream(
			new FileInputStream(file));
	Object obj = is.readUnshared();
	is.close();
	return obj;
}
 
Example 3
Source Project: samantha   File: XGBoostModel.java    License: MIT License 5 votes vote down vote up
public void loadModel(String modelFile) {
    try {
        ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(modelFile));
        this.booster = (Booster) inputStream.readUnshared();
    } catch (IOException | ClassNotFoundException e) {
        throw new BadRequestException(e);
    }
}
 
Example 4
Source Project: blazingcache   File: JDKEntrySerializer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Object deserializeObject(String key, InputStream value) throws CacheException {
    try {            
        ObjectInputStream oo2 = new ObjectInputStream(value);
        return oo2.readUnshared();
    } catch (IOException | SecurityException | ClassNotFoundException err) {
        throw new CacheException(err);
    }
}
 
Example 5
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 6
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 7
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 8
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 9
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 10
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 11
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 12
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 13
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 14
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 15
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 16
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}