Class UnixCodec


  • public class UnixCodec
    extends Codec
    Implementation of the Codec interface for '\' encoding from Unix command shell.
    Since:
    June 1, 2007
    Author:
    Jeff Williams (jeff.williams .at. aspectsecurity.com) Aspect Security
    See Also:
    Encoder
    • Constructor Detail

      • UnixCodec

        public UnixCodec()
    • Method Detail

      • encodeCharacter

        public java.lang.String encodeCharacter​(char[] immune,
                                                java.lang.Character c)
        Default implementation that should be overridden in specific codecs. Returns backslash-encoded character
        Overrides:
        encodeCharacter in class Codec
        Parameters:
        immune -
        c - the Character to encode
        Returns:
        the encoded Character
      • decodeCharacter

        public java.lang.Character decodeCharacter​(PushbackString input)
        Returns the decoded version of the next character from the input string and advances the current character in the PushbackString. If the current character is not encoded, this method MUST reset the PushbackString. Returns the decoded version of the character starting at index, or null if no decoding is possible.

        Formats all are legal both upper/lower case: \x - all special characters

        Overrides:
        decodeCharacter in class Codec
        Parameters:
        input - the Character to decode
        Returns:
        the decoded Character