Marker instruction rework
This commit is contained in:
@@ -44,6 +44,15 @@ public class JsonIO{
|
||||
}
|
||||
};
|
||||
|
||||
public static void writeBytes(Object value, Class<?> elementType, DataOutputStream output){
|
||||
json.setWriter(new UBJsonWriter(output));
|
||||
json.writeValue(value, value == null ? null : value.getClass(), elementType);
|
||||
}
|
||||
|
||||
public static <T> T readBytes(Class<T> type, Class<?> elementType, DataInputStream input) throws IOException{
|
||||
return json.readValue(type, elementType, new UBJsonReader().parseWihoutClosing(input));
|
||||
}
|
||||
|
||||
public static String write(Object object){
|
||||
return json.toJson(object, object.getClass());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user