javax.websocket

Class DecodeException

  • All Implemented Interfaces:
    Serializable

    public class DecodeException
    extends Exception
    A general exception that occurs when trying to decode a custom object from a text or binary message.
    Author:
    dannycoward
    See Also:
    Serialized Form
    • Constructor Detail

      • DecodeException

        public DecodeException(ByteBuffer bb,
                               String message,
                               Throwable cause)
        Constructor with the binary data that could not be decoded, and the reason why it failed to be, and the cause. The buffer may represent the whole message, or the part of the message most relevant to the decoding error, depending whether the application is using one of the streaming methods or not.
        Parameters:
        bb - the byte buffer containing the (part of) the message that could not be decoded.
        message - the reason for the failure.
        cause - the cause of the error.
      • DecodeException

        public DecodeException(String encodedString,
                               String message,
                               Throwable cause)
        Constructor with the text data that could not be decoded, and the reason why it failed to be, and the cause. The encoded string may represent the whole message, or the part of the message most relevant to the decoding error, depending whether the application is using one of the streaming methods or not.
        Parameters:
        encodedString - the string representing the (part of) the message that could not be decoded.
        message - the reason for the failure.
        cause - the cause of the error.
      • DecodeException

        public DecodeException(ByteBuffer bb,
                               String message)
        Constructs a DecodedException with the given ByteBuffer that cannot be decoded, and reason why. The buffer may represent the whole message, or the part of the message most relevant to the decoding error, depending whether the application is using one of the streaming methods or not.
        Parameters:
        bb - the byte buffer containing the (part of) the message that could not be decoded.
        message - the reason for the failure.
      • DecodeException

        public DecodeException(String encodedString,
                               String message)
        Constructs a DecodedException with the given encoded string that cannot be decoded, and reason why. The encoded string may represent the whole message, or the part of the message most relevant to the decoding error, depending whether the application is using one of the streaming methods or not.
        Parameters:
        encodedString - the string representing the (part of) the message that could not be decoded.
        message - the reason for the failure.
    • Method Detail

      • getBytes

        public ByteBuffer getBytes()
        Return the ByteBuffer containing either the whole message, or the partial message, that could not be decoded, or null if this exception arose from a failure to decode a text message.
        Returns:
        the binary data not decoded or null for text message failures.
      • getText

        public String getText()
        Return the encoded string that is either the whole message, or the partial message that could not be decoded, or null if this exception arose from a failure to decode a binary message..
        Returns:
        the text not decoded or null for binary message failures.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

21/08/2025 17:18:05 Cette version de la page est en cache (à la date du 21/08/2025 17:18:05) afin d'accélérer le traitement.
Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.

Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/websocket/DecodeException.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, DecodeException (Java(TM) EE 7 Specification APIs)

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.