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.
56 lines
824 B
56 lines
824 B
10 years ago
|
package mightypork.gamecore.util.ion;
|
||
10 years ago
|
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Collection;
|
||
|
|
||
|
|
||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||
10 years ago
|
public class IonSequenceWrapper implements IonObjBinary {
|
||
10 years ago
|
|
||
|
private Collection collection = new ArrayList();
|
||
|
|
||
|
|
||
|
public IonSequenceWrapper()
|
||
|
{
|
||
|
collection = new ArrayList();
|
||
|
}
|
||
|
|
||
|
|
||
|
public IonSequenceWrapper(Collection saved)
|
||
|
{
|
||
|
collection = saved;
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void load(IonInput in) throws IOException
|
||
|
{
|
||
|
collection.clear();
|
||
|
in.readSequence(collection);
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public void save(IonOutput out) throws IOException
|
||
|
{
|
||
|
out.writeSequence(collection);
|
||
|
}
|
||
|
|
||
|
|
||
|
public void fill(Collection o)
|
||
|
{
|
||
|
o.clear();
|
||
|
o.addAll(collection);
|
||
|
}
|
||
|
|
||
|
|
||
|
@Override
|
||
|
public short getIonMark()
|
||
|
{
|
||
|
return Ion.SEQUENCE_WRAPPER;
|
||
|
}
|
||
|
|
||
|
}
|