servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpSerializers.java
/**
     * Creates a {@link HttpStreamingSerializerDeserializer} that serializes {@link String}s with
     * {@code charset} encoding using fixed {@code int} length delimited framing. The framing is required so the same
     * {@link String} objects can be deserialized by the peer, otherwise the boundaries aren't known. If the desire is
     * to serialize raw data contained in the {@link String}, see {@link #stringStreamingSerializer(Charset, Consumer)}.
     * The {@link HttpHeaderNames#CONTENT_TYPE} value prefix is {@value #APPLICATION_TEXT_FIXED_STR}.
     *
     * @param charset The character encoding to use for serialization.
     * @return a {@link HttpStreamingSerializerDeserializer} that serializes {@link String}s with
     * {@code charset} encoding using fixed {@code int} length delimited framing.
     * @see FixedLengthStreamingSerializer
     */
Creates a  HttpStreamingSerializerDeserializer that serializes  Strings with
charset encoding using fixed  int length delimited framing. The framing is required so the same
String objects can be deserialized by the peer, otherwise the boundaries aren't known. If the desire is
to serialize raw data contained in the  String, see  #stringStreamingSerializer(Charset, Consumer).

@param charset The character encoding to use for serialization.
@return a  HttpStreamingSerializerDeserializer that serializes  Strings with
charset encoding using fixed  int length delimited framing.
Creates a HttpStreamingSerializerDeserializer that serializes Strings with charset encoding using fixed int length delimited framing . The framing is required so the same String objects can be deserialized by the peer otherwise the boundaries aren ' t known . If the desire is to serialize raw data contained in the String see #stringStreamingSerializer ( Charset Consumer ) . @param charset The character encoding to use for serialization . @return a HttpStreamingSerializerDeserializer that serializes Strings with charset encoding using fixed int length delimited framing .
public static HttpStreamingSerializerDeserializer<String> appSerializerFixLen(Charset charset) {
        if (UTF_8.equals(charset)) {
            return APP_STREAMING_FIX_LEN_UTF_8;
        } else if (US_ASCII.equals(charset)) {
            return APP_STREAMING_FIX_LEN_ASCII;
        }
        final int maxBytesPerChar = (int) charset.newEncoder().maxBytesPerChar();
        CharSequence contentType = newAsciiString(APPLICATION_TEXT_FIXED + "; charset=" + charset.name());
        return streamingSerializer(new FixedLengthStreamingSerializer<>(stringSerializer(charset),
                        str -> str.length() * maxBytesPerChar),
                headers -> headers.set(CONTENT_TYPE, contentType),
                headers -> hasContentType(headers, APPLICATION_TEXT_FIXED, charset));
    }
public static HttpStreamingSerializerDeserializer < String > appSerializerFixLen ( Charset charset ) { if ( UTF_8 . equals ( charset ) ) { return APP_STREAMING_FIX_LEN_UTF_8 ; } else if ( US_ASCII . equals ( charset ) ) { return APP_STREAMING_FIX_LEN_ASCII ; } final int maxBytesPerChar = ( int ) charset . newEncoder ( ) . maxBytesPerChar ( ) ; CharSequence contentType = newAsciiString ( APPLICATION_TEXT_FIXED + "; charset=" + charset . name ( ) ) ; return streamingSerializer ( new FixedLengthStreamingSerializer < > ( stringSerializer ( charset ) , str -> str . length ( ) * maxBytesPerChar ) , headers -> headers . set ( CONTENT_TYPE , contentType ) , headers -> hasContentType ( headers , APPLICATION_TEXT_FIXED , charset ) ) ; }
Creates a {@link HttpStreamingSerializerDeserializer} that serializes {@link String}s with
 {@code charset} encoding using fixed {@code int} length delimited framing.
Creates a { @link HttpStreamingSerializerDeserializer } that serializes { @link String } s with { @code charset } encoding using fixed { @code int } length delimited framing .