I converted the ebcdic input to ascii using this code using apache camel netty..
How to convert binary input to ascii? I tried with all the available charsetutil but its not working..
Any suggestions or answers available...
import java.beans.Encoder;
import org.apache.camel.main.Main;
import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.LengthFieldPrepender;
import org.jboss.netty.handler.codec.string.StringDecoder;
import org.jboss.netty.handler.codec.string.StringEncoder;
import org.jboss.netty.util.CharsetUtil;
/**
* Starting point for application
* @author SubramaniMohanam
*/
public class MainApp {
/**
* Main method
* Encoders and decoders are added here
* Route builders are added
*/
@SuppressWarnings("deprecation")
public static void main(String... args) throws Exception {
Main main = new Main();
main.enableHangupSupport();
System.out.println("main started ...");
main.bind("decoder", new LengthFieldBasedFrameDecoder(40, 0, 1,0,0));
main.bind("decoder", new LengthFieldBasedFrameDecoder(1024, 4, 2,0,17));
main.bind( "stringEncoder", new StringEncoder("Cp1047"));
main.bind("stringDecoder", new StringDecoder("Cp1047"));
main.addRouteBuilder(new StationRouteBuilder());
main.run(args);
}
}