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

The following examples show how to use java.io.ObjectInputStream#readUnshared() . 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
Source File: StandardKeySerializer.java    From blazingcache with Apache License 2.0 6 votes vote down vote up
@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 File: Fs.java    From DeepDriver with 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 File: XGBoostModel.java    From samantha with 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 File: JDKEntrySerializer.java    From blazingcache with 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
Source File: CommandAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 6
Source File: ResponseAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 7
Source File: ATR.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 8
Source File: CommandAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 9
Source File: ResponseAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 10
Source File: ATR.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 11
Source File: CommandAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 12
Source File: ResponseAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 13
Source File: ATR.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 14
Source File: CommandAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   this.parse();
}
 
Example 15
Source File: ResponseAPDU.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.apdu = (byte[])((byte[])in.readUnshared());
   check(this.apdu);
}
 
Example 16
Source File: ATR.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   this.atr = (byte[])((byte[])in.readUnshared());
   this.parse();
}