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

com.sportradar.livedata.sdk.proto.common.MessageWriter Maven / Gradle / Ivy

Go to download

Livedata SDK is a client library that enables easier integration with the Livedata XML feed. SDK exposes XML feed service interface in a more user-friendly way and isolates the client from having to do XML feed parsing, proper connection handling, error recovery, event queuing and dispatching. It also makes a client solution more stable and robust when it comes to feed handling, especially with the release of new and updated XML feed versions.

There is a newer version: 2.0.10
Show newest version
/***************************************************************
 * Copyright (c) 2013, Sportradar AG                           *
 ***************************************************************/

package com.sportradar.livedata.sdk.proto.common;

import com.sportradar.livedata.sdk.proto.dto.MessageBase;

/**
 * Represents a writer capable of writing message data to byte array
 *
 * @param  Specifies the type of the messages recognized by the writer.
 */
public interface MessageWriter {

    /**
     * Writes the passed message to the returned {@code byte[]}
     *
     * @param message The message to be written to the array.
     * @return The {@code byte[]} containing message data.
     * @throws ProtocolException thrown when an un-expected situation is encountered.
     * @throws MessageException The {@code message} could not be written to specified media
     */
    byte[] write(T message) throws ProtocolException, MessageException;

    /**
     * Gets the configured character encoding for the writer.
     *
     * @return a string, i.e. UTF-8
     */
    String getEncoding();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy