Commit 460e924f authored by Andreas Wahlen's avatar Andreas Wahlen
Browse files

Implemented toBinary and fromBinary for StructType

parent 11788ee7
Pipeline #423837 passed with stage
in 32 seconds
......@@ -189,12 +189,19 @@ public class StructType extends DataType implements CustomJson {
@Override
public void toBinary(DataOutputStream os, Object o) throws IOException {
throw new IllegalArgumentException("Unimplemented");
Object[] arr = (Object[]) o;
for(int i=0;i<this.getFieldCount();i++){
field_types.elementAt(i).toBinary(os, arr[i]);
}
}
@Override
public Object fromBinary(DataInputStream is) throws IOException {
throw new IllegalArgumentException("Unimplemented");
Object[] arr = new Object[this.getFieldCount()];
for(int i=0;i<arr.length;i++){
arr[i] = this.field_types.elementAt(i).fromBinary(is);
}
return (Object) arr;
}
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment