class ListenTCP extends AbstractListenEventBatchingProcessor<StandardEvent> {

    public Map<String, String> unpackContent(String annotation, byte[] data, Charset charset) {
        Map<String, String> attributes = new HashMap();
        int from = 0, to = 0;
        ArrayList<UnPackingInfo> unpackingInfos = parseUnPackingInfos(annotation);
        for (int i=0; i<unpackingInfos.size(); i++) {
            UnPackingInfo info = unpackingInfos.get(i);
            int length = info.length;
            to += length;
            byte[] subArray = Arrays.copyOfRange(data, from, to);
            attributes.put(info.name, new String(subArray, charset));
            from = to;
        }
        return attributes;
    }

}