private double internalReadDouble(int code) throws IOException {
        switch (code) {
            case Codes.DOUBLE:
                return is.readRawDouble();
            case Codes.DOUBLE_0:
                return 0.0D;
            case Codes.DOUBLE_1:
                return 1.0D;
            default: {
                Object o = read(code);
                if (o instanceof Double) {
                    return (Double) o;
                } else {
                    throw expected("double", code, o);
                }
            }
        }
    }