class EdgeKeyDecoder {

    public static String getYYYYMMDD(Text colQual) {
        int numCharsToCheck = Math.min(DATE_LEN + 1, colQual.getLength());
        
        int firstSlashIndex = DATE_LEN; // there may not be a slash
        byte[] bytes = colQual.getBytes();
        
        // find the first slash if it exists
        for (int i = 0; i < numCharsToCheck; i++) {
            if (bytes[i] == COL_SEPARATOR_BYTE) {
                firstSlashIndex = i;
                break;
            }
        }
        
        try {
            return Text.decode(colQual.getBytes(), 0, Math.min(colQual.getLength(), firstSlashIndex));
        } catch (CharacterCodingException e) {
            // same behavior as EdgeKey.getParts
            throw new RuntimeException("Edge key column encoding exception", e);
        }
    }

    public  EdgeKeyDecoder();

}