<commit_before>package chaz.trade.input.okcoin;

import com.google.gson.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.websocket.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.zip.GZIPInputStream;

/**
 * Created by Administrator on 2017/8/31.
 */
@ClientEndpoint
public class EndPoint {
    private static final Logger LOGGER = LoggerFactory.getLogger(EndPoint.class);

    @OnOpen
    public void onOpen(Session session) {
        LOGGER.info("Connected to server: " + session.getBasicRemote());
        try {
            SubscribeRequestModel model = new SubscribeRequestModel();
            model.setEvent("addChannel");
            model.setChannel("ok_sub_spotcny_btc_depth_20");
            Gson gson = new GsonBuilder().create();
            session.getBasicRemote().sendText(gson.toJson(model));
        } catch (IOException ex) {
            LOGGER.error("got exception", ex);
        }
    }

    @OnMessage
    public void processMessage(String message) {
        JsonElement jelement = new JsonParser().parse(message);
        JsonObject jobject = jelement.getAsJsonObject();
        if (jobject.has("channel")) {
            if (StringUtils.equals(jobject.get("channel").getAsString(),"ok_sub_spotcny_btc_depth_20")) {
                LOGGER.info("subscribe huibi market scueess");
            }
        }
    }

    @OnMessage
    public void processBinary(byte[] bytes) throws IOException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ByteArrayInputStream in = new ByteArrayInputStream(new String(bytes, StandardCharsets.ISO_8859_1).getBytes("ISO-8859-1"));
        GZIPInputStream gunzip = new GZIPInputStream(in);
        byte[] buffer = new byte[256];
        int n;
        while ((n = gunzip.read(buffer)) >= 0) {
            out.write(buffer, 0, n);
        }
        LOGGER.info("received bytes {}",out.toString());
    }

    @OnError
    public void processError(Throwable t) {
        LOGGER.error("got error from server", t);
    }
}<commit_msg>remove bytes processor<commit_after>package chaz.trade.input.okcoin;

import com.google.gson.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.websocket.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.zip.GZIPInputStream;

/**
 * Created by Administrator on 2017/8/31.
 */
@ClientEndpoint
public class EndPoint {
    private static final Logger LOGGER = LoggerFactory.getLogger(EndPoint.class);

    @OnOpen
    public void onOpen(Session session) {
        LOGGER.info("Connected to server: " + session.getBasicRemote());
        try {
            SubscribeRequestModel model = new SubscribeRequestModel();
            model.setEvent("addChannel");
            model.setChannel("ok_sub_spotcny_btc_depth_20");
            Gson gson = new GsonBuilder().create();
            session.getBasicRemote().sendText(gson.toJson(model));
        } catch (IOException ex) {
            LOGGER.error("got exception", ex);
        }
    }

    @OnMessage
    public void processMessage(String message) {
        LOGGER.info("received message:"+message);
//        JsonElement jelement = new JsonParser().parse(message);
//        JsonObject jobject = jelement.getAsJsonObject();
//        if (jobject.has("channel")) {
//            if (StringUtils.equals(jobject.get("channel").getAsString(),"ok_sub_spotcny_btc_depth_20")) {
//                LOGGER.info("subscribe huibi market scueess");
//            }
//        }
    }

    @OnError
    public void processError(Throwable t) {
        LOGGER.error("got error from server", t);
    }
}
{'fraction_non_alphanumeric': 0.11799334527770668, 'fraction_numerical': 0.011005886869721013, 'mean_word_length': 2.9959100204498976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '930180', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1131, 'n_words': 229}