Package io.undertow.websockets.jsr

Examples of io.undertow.websockets.jsr.UTF8Output


            if (textMessage == null) {
                onError(s, JsrWebSocketMessages.MESSAGES.receivedTextFrameButNoMethod());
                return;
            }
            if (assembledTextFrame == null) {
                assembledTextFrame = new UTF8Output();
            }
            UTF8Output builder = assembledTextFrame;
            builder.write(payload);
            if (header.isLastFragement() || (textMessage.hasParameterType(boolean.class) && !textMessage.isDecoderRequired() && builder.hasData())) {
                Object messageObject;
                if (textMessage.isDecoderRequired()) {
                    try {
                        messageObject = session.getEncoding().decodeText(textMessage.getMessageType(), builder.extract());
                    } catch (DecodeException e) {
                        onError(s, e);
                        return;
                    }
                } else if (textMessage.getMessageType().equals(Reader.class)) {
                    messageObject = new StringReader(builder.extract());
                } else {
                    messageObject = builder.extract();
                }

                final Map<Class<?>, Object> params = new HashMap<Class<?>, Object>();
                params.put(Session.class, session);
                params.put(Map.class, session.getPathParameters());
View Full Code Here


            if (textMessage == null) {
                onError(s, JsrWebSocketMessages.MESSAGES.receivedTextFrameButNoMethod());
                return;
            }
            if (assembledTextFrame == null) {
                assembledTextFrame = new UTF8Output();
            }
            UTF8Output builder = assembledTextFrame;
            builder.write(payload);
            if (header.isLastFragement() || (textMessage.hasParameterType(boolean.class) && !textMessage.isDecoderRequired() && builder.hasData())) {
                Object messageObject;
                if (textMessage.isDecoderRequired()) {
                    try {
                        messageObject = session.getEncoding().decodeText(textMessage.getMessageType(), builder.extract());
                    } catch (DecodeException e) {
                        onError(s, e);
                        return;
                    }
                } else {
                    messageObject = builder.extract();
                }

                final Map<Class<?>, Object> params = new HashMap<>();
                params.put(Session.class, session);
                params.put(Map.class, session.getPathParameters());
View Full Code Here

TOP

Related Classes of io.undertow.websockets.jsr.UTF8Output

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.