public String generateStringKeyFor(final Object key) throws IOException { if (key instanceof String) { return (String) key; } ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new OOS(bos, oscSerializer); writeStringKey(key, oos); oos.close(); return bos.toString(0x00); }
public String generateStringKeyFor(final Object key) throws IOException { if (key instanceof String) { return (String) key; } ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new OOS(bos, oscSerializer); writeStringKey(key, oos); oos.close(); return bos.toString(0x00); }
public String generateStringKeyFor(final Object key) throws IOException { if (key instanceof String) { return (String) key; } ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new OOS(bos, oscSerializer); writeStringKey(key, oos); oos.close(); return bos.toString(0x00); }
public String generateStringKeyFor(final Object key) throws IOException { if (key instanceof String) { return (String) key; } ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new OOS(bos, oscSerializer); writeStringKey(key, oos); oos.close(); return bos.toString(0x00); }
/** * Special cases the CacheKey class in order to reduce the size of the generated Strings. */ @Override protected void writeStringKey(final Object key, final ObjectOutputStream oos) throws IOException { if (key instanceof CacheKey) { CacheKey cacheKey = (CacheKey) key; oos.writeInt(getOrCreateMapping(cacheKey.getEntityOrRoleName())); oos.writeObject(cacheKey.getKey()); } else { super.writeStringKey(key, oos); } }