You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
671 B
54 lines
671 B
package mightypork.utils.ion;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
|
|
|
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
|
class IonMapWrapper implements IonObjBinary {
|
|
|
|
private final Map map;
|
|
|
|
|
|
public IonMapWrapper()
|
|
{
|
|
map = new LinkedHashMap<>();
|
|
}
|
|
|
|
|
|
public IonMapWrapper(Map saved)
|
|
{
|
|
map = saved;
|
|
}
|
|
|
|
|
|
@Override
|
|
public void load(IonInput in) throws IOException
|
|
{
|
|
map.clear();
|
|
in.readMap(map);
|
|
}
|
|
|
|
|
|
@Override
|
|
public void save(IonOutput out) throws IOException
|
|
{
|
|
out.writeMap(map);
|
|
}
|
|
|
|
|
|
public void fill(Map o)
|
|
{
|
|
o.clear();
|
|
o.putAll(map);
|
|
}
|
|
|
|
|
|
public Map getMap()
|
|
{
|
|
return map;
|
|
}
|
|
|
|
}
|
|
|