Example usage for io.netty.handler.codec.marshalling MarshallingEncoder MarshallingEncoder

List of usage examples for io.netty.handler.codec.marshalling MarshallingEncoder MarshallingEncoder

Introduction

In this page you can find the example usage for io.netty.handler.codec.marshalling MarshallingEncoder MarshallingEncoder.

Prototype

public MarshallingEncoder(MarshallerProvider provider) 

Source Link

Document

Creates a new encoder.

Usage

From source file:books.netty.codec.marshalling.MarshallingCodeCFactory.java

License:Apache License

/**
 * Jboss Marshalling?MarshallingEncoder//from  w  w  w. j  a  v  a 2 s .  co m
 *
 * @return
 */
public static MarshallingEncoder buildMarshallingEncoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    MarshallerProvider provider = new DefaultMarshallerProvider(marshallerFactory, configuration);
    MarshallingEncoder encoder = new MarshallingEncoder(provider);
    return encoder;
}

From source file:netty.codec.marshalling.MarshallingCodeCFactory.java

License:Apache License

/**
 * Jboss Marshalling?MarshallingEncoder/*  w ww. j av  a2 s  .  c  om*/
 *
 * @return
 */
public static MarshallingEncoder buildMarshallingEncoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    MarshallerProvider provider = new DefaultMarshallerProvider(marshallerFactory, configuration);
    return new MarshallingEncoder(provider);
}