java.lang.Object
ch.raffael.meldioc.library.http.server.undertow.codec.BinaryCodec<T>
All Implemented Interfaces:
HttpDecoder<T>, HttpEncoder<T>
Direct Known Subclasses:
BinaryCodec.ByteArray, BinaryCodec.ByteBuffer, BinaryCodec.ByteBufferArray

public abstract class BinaryCodec<T> extends Object implements HttpEncoder<T>, HttpDecoder<T>
  • Constructor Details

    • BinaryCodec

      protected BinaryCodec(String... contentTypes)
    • BinaryCodec

      protected BinaryCodec(ch.raffael.meldioc.library.codec.ContentType contentType)
  • Method Details

    • decode

      public void decode(io.undertow.server.HttpServerExchange exchange, HttpDecoder.Consumer<? super T> consumer) throws Exception
      Specified by:
      decode in interface HttpDecoder<T>
      Throws:
      Exception
    • encode

      public void encode(io.undertow.server.HttpServerExchange exchange, T value)
      Specified by:
      encode in interface HttpEncoder<T>
    • toByteBuffers

      protected abstract ByteBuffer[] toByteBuffers(T value)
    • fromBytes

      protected abstract T fromBytes(byte[] bytes)