public Object deserializeStringKey(String key, ClassLoader loader) throws IOException, ClassNotFoundException { if (key.length() >= 1 && key.charAt(0) == MARKER) { // return readStringKey(new OIS(new StringSerializedObjectInputStream(key), oscSerializer, loader)); } return key; }
@Override public String generateStringKeyFor(final Object key) throws IOException { if (key instanceof String) { String stringKey = (String) key; // disallow Strings that start with our marker if (stringKey.length() >= 1) { if (stringKey.charAt(0) == MARKER) { // throw new IOException("Illegal string key: " + stringKey); } } return stringKey; } StringSerializedObjectOutputStream out = new StringSerializedObjectOutputStream(); ObjectOutputStream oos = new OOS(out, oscSerializer); writeStringKey(key, oos); oos.close(); return out.toString(); }
@Override public String generateStringKeyFor(final Object key) throws IOException { if (key instanceof String) { String stringKey = (String) key; // disallow Strings that start with our marker if (stringKey.length() >= 1) { if (stringKey.charAt(0) == MARKER) { // throw new IOException("Illegal string key: " + stringKey); } } return stringKey; } StringSerializedObjectOutputStream out = new StringSerializedObjectOutputStream(); ObjectOutputStream oos = new OOS(out, oscSerializer); writeStringKey(key, oos); oos.close(); return out.toString(); }
public Object deserializeStringKey(final String key) throws IOException, ClassNotFoundException { if (key.length() >= 1 && key.charAt(0) == MARKER) { // return readStringKey(new OIS(new StringSerializedObjectInputStream(key), oscSerializer)); } return key; }