All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zipkin2.codec.BytesEncoder Maven / Gradle / Ivy

There is a newer version: 3.4.2
Show newest version
/*
 * Copyright The OpenZipkin Authors
 * SPDX-License-Identifier: Apache-2.0
 */
package zipkin2.codec;

import java.util.List;

/**
 * Utility for encoding one or more elements of a type into a byte array.
 *
 * @param  type of the object to encode
 */
public interface BytesEncoder {
  Encoding encoding();

  int sizeInBytes(T input);

  /** Serializes an object into its binary form. */
  byte[] encode(T input);

  /** Serializes a list of objects into their binary form. */
  byte[] encodeList(List input);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy