Module swim.codec
Package swim.codec

Class Unicode


  • public final class Unicode
    extends Object
    Unicode code point Input/Output/Writer factory.

    The Unicode.stringInput(...) family of functions return an Input that reads the Unicode code points of a String.

    The Unicode.stringOutput(...) family of functions return an Output that writes Unicode code points to an internal buffer, and bind a String containing all written code points.

    • Method Detail

      • stringInput

        public static Input stringInput​(String string)
      • stringOutput

        public static Output<String> stringOutput​(StringBuilder builder,
                                                  OutputSettings settings)
        Returns a new Output that writes Unicode code points to the given string builder, using the given output settings. The returned Output accepts an unbounded number of code points, remaining permanently in the cont state, and binds a String containing all written code points.
      • stringOutput

        public static Output<String> stringOutput​(StringBuilder builder)
        Returns a new Output that writes Unicode code points to the given string builder. The returned Output accepts an unbounded number of code points, remaining permanently in the cont state, and binds a String containing all written code points.
      • stringOutput

        public static Output<String> stringOutput​(String string,
                                                  OutputSettings settings)
        Returns a new Output that appends Unicode code points to the given string, using the given output settings. The returned Output accepts an unbounded number of code points, remaining permanently in the cont state, and binds a String containing the given string, and all appended code points.
      • stringOutput

        public static Output<String> stringOutput​(String string)
        Returns a new Output that appends Unicode code points to the given string. The returned Output accepts an unbounded number of code points, remaining permanently in the cont state, and binds a String containing the given string, and all appended code points.
      • stringOutput

        public static Output<String> stringOutput​(int initialCapacity)
      • stringOutput

        public static Output<String> stringOutput​(OutputSettings settings)
        Returns a new Output that buffers Unicode code points, using the given output settings. The returned Output accepts an unbounded number of code points, remaining permanently in the cont state, and binds a String containing all written code points.
      • stringOutput

        public static Output<String> stringOutput()
        Returns a new Output that buffers Unicode code points. The returned Output accepts an unbounded number of code points, remaining permanently in the cont state, and binds a String containing all written code points.
      • stringParser

        public static Parser<String> stringParser()
      • outputParser

        public static <O> Parser<O> outputParser​(Output<O> output)
      • parseOutput

        public static <O> Parser<O> parseOutput​(Output<O> output,
                                                Input input)
      • nullParser

        public static <O> Parser<O> nullParser()
      • parseNull

        public static <O> Parser<O> parseNull​(Input input)
      • stringWriter

        public static <I> Writer<I,​Object> stringWriter()
      • stringWriter

        public static <I,​O> Writer<I,​O> stringWriter​(O input)