Examples of EncodeException


Examples of javax.websocket.EncodeException

                    try {
                        StringWriter out = new StringWriter();
                        ((Encoder.TextStream) decoder).encode(o, out);
                        return out.toString();
                    } catch (IOException e) {
                        throw new EncodeException(o, "Could not encode text", e);
                    }
                }
            }
        }

        if (EncodingFactory.isPrimitiveOrBoxed(o.getClass())) {
            return o.toString();
        }
        throw new EncodeException(o, "Could not encode text");
    }
View Full Code Here

Examples of javax.websocket.EncodeException

                    try {
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ((Encoder.BinaryStream) decoder).encode(o, out);
                        return ByteBuffer.wrap(out.toByteArray());
                    } catch (IOException e) {
                        throw new EncodeException(o, "Could not encode binary", e);
                    }
                }
            }
        }
        throw new EncodeException(o, "Could not encode binary");
    }
View Full Code Here

Examples of javax.websocket.EncodeException

                    try {
                        StringWriter out = new StringWriter();
                        ((Encoder.TextStream) decoder).encode(o, out);
                        return out.toString();
                    } catch (IOException e) {
                        throw new EncodeException(o, "Could not encode text", e);
                    }
                }
            }
        }
        throw new EncodeException(o, "Could not encode text");
    }
View Full Code Here

Examples of javax.websocket.EncodeException

                    try {
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ((Encoder.BinaryStream) decoder).encode(o, out);
                        return ByteBuffer.wrap(out.toByteArray());
                    } catch (IOException e) {
                        throw new EncodeException(o, "Could not encode binary", e);
                    }
                }
            }
        }
        throw new EncodeException(o, "Could not encode binary");
    }
View Full Code Here

Examples of javax.websocket.EncodeException

                    return writer;
                }
            }
        }

        throw new EncodeException(message, LocalizationMessages.ENCODING_FAILED());
    }
View Full Code Here

Examples of javax.websocket.EncodeException

                try (OutputStream os = getSendStream()) {
                    ((Encoder.BinaryStream) encoder).encode(obj, os);
                }
                completion.onResult(new SendResult());
            } else {
                throw new EncodeException(obj, sm.getString(
                        "wsRemoteEndpoint.noEncoder", obj.getClass()));
            }
        } catch (EncodeException | IOException e) {
            SendResult sr = new SendResult(e);
            completion.onResult(sr);
View Full Code Here

Examples of javax.websocket.EncodeException

                try (OutputStream os = getSendStream()) {
                    ((Encoder.BinaryStream) encoder).encode(obj, os);
                }
                completion.onResult(new SendResult());
            } else {
                throw new EncodeException(obj, sm.getString(
                        "wsRemoteEndpoint.noEncoder", obj.getClass()));
            }
        } catch (EncodeException | IOException e) {
            SendResult sr = new SendResult(e);
            completion.onResult(sr);
View Full Code Here

Examples of javax.websocket.EncodeException

  public M encode(T object) throws EncodeException {
    try {
      return (M) getConversionService().convert(object, getType(), getMessageType());
    }
    catch (ConversionException ex) {
      throw new EncodeException(object, "Unable to encode websocket message using ConversionService", ex);
    }
  }
View Full Code Here

Examples of javax.websocket.EncodeException

                    return writer;
                }
            }
        }

        throw new EncodeException(message, "Encoding failed.");
    }
View Full Code Here

Examples of javax.websocket.EncodeException

                        }
                    }
                }
                completion.onResult(new SendResult());
            } else {
                throw new EncodeException(obj, sm.getString(
                        "wsRemoteEndpoint.noEncoder", obj.getClass()));
            }
        } catch (EncodeException e) {
            SendResult sr = new SendResult(e);
            completion.onResult(sr);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.