Example usage for org.apache.solr.common.util ContentStreamBase DEFAULT_CHARSET

List of usage examples for org.apache.solr.common.util ContentStreamBase DEFAULT_CHARSET

Introduction

In this page you can find the example usage for org.apache.solr.common.util ContentStreamBase DEFAULT_CHARSET.

Prototype

String DEFAULT_CHARSET

To view the source code for org.apache.solr.common.util ContentStreamBase DEFAULT_CHARSET.

Click Source Link

Usage

From source file:org.vootoo.client.netty.util.ProtobufContentStream.java

License:Apache License

@Override
public Reader getReader() throws IOException {
    String charset = ContentStreamBase.getCharsetFromContentType(getContentType());
    return charset == null ? new InputStreamReader(getStream(), ContentStreamBase.DEFAULT_CHARSET)
            : new InputStreamReader(getStream(), charset);
}

From source file:org.vootoo.client.netty.util.ProtobufUtil.java

License:Apache License

public static String getResponseBodyCharset(SolrProtocol.SolrResponse protocolResponse) {
    String charset = ContentStreamBase.DEFAULT_CHARSET;
    if (protocolResponse != null) {
        SolrProtocol.ResponseBody responseBody = protocolResponse.getResponseBody();
        if (responseBody != null) {
            charset = ContentStreamBase.getCharsetFromContentType(responseBody.getContentType());
        }//from ww  w .  j a  v  a2  s. c  om
    }
    return charset;
}