MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / serializeToBytes

Method serializeToBytes

src/utils/JSON.java:290–298  ·  view source on GitHub ↗

Serializes the given object to a JSON byte array @param object The object to serialize @return A JSON formatted byte array @throws IllegalArgumentException if the object was null @throws JSONException if the object could not be serialized

(final Object object)

Source from the content-addressed store, hash-verified

288 * @throws JSONException if the object could not be serialized
289 */
290 public static final byte[] serializeToBytes(final Object object) {
291 if (object == null)
292 throw new IllegalArgumentException("Object was null");
293 try {
294 return jsonMapper.writeValueAsBytes(object);
295 } catch (JsonProcessingException e) {
296 throw new JSONException(e);
297 }
298 }
299
300 /**
301 * Serializes the given object and wraps it in a callback function

Callers 14

serializeToBytesMethod · 0.95
setupStorageMethod · 0.95
setupStorageMethod · 0.95
createNewTreeOutOfIDsMethod · 0.95
setupStorageMethod · 0.95
serializeJSONMethod · 0.95
executeMethod · 0.95
executeMethod · 0.95
executeMethod · 0.95
executeMethod · 0.95
isDiskCacheHitMethod · 0.95
executeMethod · 0.95

Calls

no outgoing calls

Tested by 5

serializeToBytesMethod · 0.76
setupStorageMethod · 0.76
setupStorageMethod · 0.76
createNewTreeOutOfIDsMethod · 0.76
setupStorageMethod · 0.76