class EdgeKeyDecoder {

    public static STATS_TYPE determineStatsType(Text colFam) {
        int offset = STATS_BYTES.length + 1;
        int secondSlashIndex = 0;
        int numCharsToCheck = Math.min(offset + 1 + STATS_TYPE.getMaxLength(), colFam.getLength());
        
        // faster to just compare bytes with STATS/statsType/ for each statsType
        
        for (int i = offset; i < numCharsToCheck; i++) {
            secondSlashIndex = i;
            if (colFam.getBytes()[i] == COL_SEPARATOR_BYTE) {
                break;
            }
        }
        int count = (secondSlashIndex > offset ? secondSlashIndex - offset : offset);
        try {
            return STATS_TYPE.getStatsType(Text.decode(colFam.getBytes(), offset, count));
        } catch (CharacterCodingException e) {
            // same behavior as EdgeKey.getParts
            throw new RuntimeException("Edge key column encoding exception", e);
        }
    }

    public  EdgeKeyDecoder();

}