mantis-common/src/main/java/io/mantisrx/common/codec/Codecs.java [60:118]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        };
    }

    private static Codec<String> stringWithEncoding(String encoding) {
        final Charset charset = Charset.forName(encoding);

        return new Codec<String>() {
            @Override
            public String decode(byte[] bytes) {
                return new String(bytes, charset);
            }

            @Override
            public byte[] encode(final String value) {
                return value.getBytes(charset);
            }
        };
    }

    public static Codec<String> stringAscii() {

        final Charset charset = Charset.forName("US-ASCII");

        return new Codec<String>() {
            @Override
            public String decode(byte[] bytes) {
                return new String(bytes, charset);
            }

            @Override
            public byte[] encode(final String value) {
                final byte[] bytes = new byte[value.length()];
                for (int i = 0; i < value.length(); i++)
                    bytes[i] = (byte) value.charAt(i);
                return bytes;
            }
        };
    }

    public static Codec<String> stringUtf8() {
        return stringWithEncoding("UTF-8");
    }

    public static Codec<String> string() {
        return stringUtf8();
    }

    public static Codec<byte[]> bytearray() {
        return new Codec<byte[]>() {
            @Override
            public byte[] decode(byte[] bytes) {
                return bytes;
            }

            @Override
            public byte[] encode(final byte[] value) {
                return value;
            }
        };
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



mantis-remote-observable/src/main/java/io/reactivex/netty/codec/Codecs.java [41:99]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        };
    }

    private static Codec<String> stringWithEncoding(String encoding) {
        final Charset charset = Charset.forName(encoding);

        return new Codec<String>() {
            @Override
            public String decode(byte[] bytes) {
                return new String(bytes, charset);
            }

            @Override
            public byte[] encode(final String value) {
                return value.getBytes(charset);
            }
        };
    }

    public static Codec<String> stringAscii() {

        final Charset charset = Charset.forName("US-ASCII");

        return new Codec<String>() {
            @Override
            public String decode(byte[] bytes) {
                return new String(bytes, charset);
            }

            @Override
            public byte[] encode(final String value) {
                final byte[] bytes = new byte[value.length()];
                for (int i = 0; i < value.length(); i++)
                    bytes[i] = (byte) value.charAt(i);
                return bytes;
            }
        };
    }

    public static Codec<String> stringUtf8() {
        return stringWithEncoding("UTF-8");
    }

    public static Codec<String> string() {
        return stringUtf8();
    }

    public static Codec<byte[]> bytearray() {
        return new Codec<byte[]>() {
            @Override
            public byte[] decode(byte[] bytes) {
                return bytes;
            }

            @Override
            public byte[] encode(final byte[] value) {
                return value;
            }
        };
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



