Interface ContentEncodingScheme


  • public interface ContentEncodingScheme
    Encoding scheme of the content of the JSON string.
    Author:
    leadpony
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canDecode​(String src)
      Checks whether the specified string is encoded in this scheme or not.
      byte[] decode​(String src)
      Decodes the encoded string into a newly allocated byte array using this encoding scheme.
      String name()
      Returns the name of this encoding scheme.
    • Method Detail

      • name

        String name()
        Returns the name of this encoding scheme.
        Returns:
        the name of this encoding scheme, cannot be null.
      • canDecode

        boolean canDecode​(String src)
        Checks whether the specified string is encoded in this scheme or not.
        Parameters:
        src - the string to check.
        Returns:
        true if the specified src is encoded in this scheme, false otherwise.
        Throws:
        NullPointerException - if the specified src is null.
      • decode

        byte[] decode​(String src)
        Decodes the encoded string into a newly allocated byte array using this encoding scheme.
        Parameters:
        src - the string to decode.
        Returns:
        newly allocated byte array containing the decoded bytes.
        Throws:
        NullPointerException - if the specified src is null.
        IllegalArgumentException - if the specified src cannot be decoded.