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

com.obsidiandynamics.blackstrom.codec.MessageCodec Maven / Gradle / Ivy

The newest version!
package com.obsidiandynamics.blackstrom.codec;

import com.obsidiandynamics.blackstrom.model.*;

public interface MessageCodec {
  int SCHEMA_VERSION = 2;
  
  byte[] encode(Message message) throws Exception;
  
  default String encodeText(Message message) throws Exception {
    return new String(encode(message));
  }
  
  Message decode(byte[] bytes) throws Exception;
  
  default Message decodeText(String text) throws Exception {
    return decode(text.getBytes());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy