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

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

Introduction

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

Prototype

public MarshallingDecoder(UnmarshallerProvider provider, int maxObjectSize) 

Source Link

Document

Creates a new decoder with the specified maximum object size.

Usage

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

License:Apache License

/**
 * Jboss Marshalling?MarshallingDecoder/*from w  ww .j a v a 2 s  .co m*/
 *
 * @return
 */
public static MarshallingDecoder buildMarshallingDecoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    UnmarshallerProvider provider = new DefaultUnmarshallerProvider(marshallerFactory, configuration);
    MarshallingDecoder decoder = new MarshallingDecoder(provider, 1024);
    return decoder;
}

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

License:Apache License

/**
 * Jboss Marshalling?MarshallingDecoder//  w  ww.  ja  v  a2s  .  c  o  m
 *
 * @return
 */
public static MarshallingDecoder buildMarshallingDecoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    UnmarshallerProvider provider = new DefaultUnmarshallerProvider(marshallerFactory, configuration);
    return new MarshallingDecoder(provider, 1024 << 2);
}

From source file:org.artJava.upload.codec.MarshallingCodeCFactory.java

License:Apache License

/**
 * Jboss Marshalling?MarshallingDecoder//from   w  w w.ja v a 2s . c  om
 * 
 * @return
 */
public static MarshallingDecoder buildMarshallingDecoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    UnmarshallerProvider provider = new DefaultUnmarshallerProvider(marshallerFactory, configuration);
    MarshallingDecoder decoder = new MarshallingDecoder(provider, 3 * 1024 * 1024);
    return decoder;
}